I'm trying to setup sudo with no password but still I get prompted for password.
I'm using Ubuntu, here is the relevant line from the sudoers configuration file :
gandalf ALL=(ALL:ALL) NOPASSWD: ALL
on 07/26/2012 – Made popular on 07/26/2012
I visudoed sudoers to allow a user to run one bash script with a passwordless sudo, which works fine when logged in (also via SSH). However, when I log in via SSH using public key authentication and configure authorized_keys' command="sudo myScript", I am promped for the user password by sudo. Having the script itself use sudo on another program does however work without requiring a password.
When I create new Ubuntu 12.10 instances, I typically bootstrap them by manually SSHing onto the machine and editing the sudoers to put a NOPASSWD on the default user (e.g., ec2-user, azureuser, etc.). Then my install scripts can sudo various commands without having to provide a password.
A PHP program I am working with (LConf) calls a script using sudo.
I have allowed the user apache to run the script and have tested with sudo -u apache /usr/local/LConf/lconf_deploy.sh.
I am being prompted for a password when lconf_deploy.sh calls /usr/bin/sudo -u icinga /usr/local/LConf/LConfExport.pl -o /etc/icinga/lconf -v, but have no problems calling lines before or after this line.
I'm running Ubuntu 11.10. I'm trying to setup a user that's essentially a clone of the permissions of the ubuntu user. This works but I'm not able to sudo with this new user without supplying a password (which I don't even have for this user).