Here is what went wrong:
$ sudo cat /etc/sudoers.d/90-cloudimg-ubuntu
# ubuntu user is default user in cloud-images.
# It needs passwordless sudo functionality.
ubuntu ALL=(ALL) NOPASSWD:ALL
The user provisioned was 'smoser'. but 'ubuntu' was given passwordless sudo.
Here is what went wrong: d/90-cloudimg- ubuntu
$ sudo cat /etc/sudoers.
# ubuntu user is default user in cloud-images.
# It needs passwordless sudo functionality.
ubuntu ALL=(ALL) NOPASSWD:ALL
The user provisioned was 'smoser'. but 'ubuntu' was given passwordless sudo.