I'm trying to script the creation of a user with
sudo access for my ec2 instances.
I'm having problems setting up sudo access. I'm running the following as root...
adduser --disabled-password --gecos "" testuser usermod -a -G admin,sudo testuser
I then copy the authorized_keys from s3.
The ssh works fine at this point.
However if I try to sudo, I'm prompted for a password.
My sudoers file includes the following...
# 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
Apart from logging out and logging back in, is there anything I need to do to actually make my changes take effect?
I didn't change the sudoers file, this was the default setup.
Also there's another system created user
ubuntu, which can sudo successfully. However there is no explicit mention of this user in the
sudoers file, so it must be doing it through group membership.
update: I tried adding every other group that "ubuntu" belongs to testuser, but I'm still being prompted for the password.
Is there any way I can figure out how "ubuntu" gets passwordless sudo access?