This is for a 12.04 ec2 instance.
In the man pages it says the default should be to require a password when using sudo. I thought by setting the ubuntu's account password (in case it wasn't set) that might start prompting me for a password when using sudo, but when I used the passwd command it required me to enter the original password before allowing me to change it. So, even though it appeared to be set already, it wasn't prompting me for a sudo pass, and after I used sudo to override and change the ubuntu account password, it still is not asking for a sudo pass.
Anyway, I'm not sure how important those details actually are. Here is my sudoers file:
#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL:ALL) ALL
# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
# See sudoers(5) for more information on "#include" directives:
#includedir /etc/sudoers.d
In all the examples I've come across where people didn't know why they had passwordless sudo setup, it seemed to be because of some sort of explicit "NOPASSWD:ALL" line in the sudoers file (which mine doesn't have). I tried doing:
%admin ALL:(ALL) PASSWD: ALL
but it didn't help.
id output:
uid=1000(ubuntu) gid=1000(ubuntu) groups=1000(ubuntu),4(adm),20(dialout),24(cdrom),25(floppy),29(audio),30(dip),44(video),46(plugdev),110(netdev),111(admin)