I'm trying to setup sudo without 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
I believe the correct line is:
gandalf ALL=(ALL) NOPASSWD: ALL
Put it in the end of the file - replace gandalf
with the appropriate username. (To edit the file, run the command sudo visudo
.)
There is one note to mention. That line should be at end of the /etc/sudoers file.
Why: because some configuration lines from /etc/sudoers overwrite our line.
gandalf ALL=(ALL:ALL) NOPASSWD: ALL
sudo
is designed to facilitate passwordless operation easily and even has ready-to-go commented configuration lines in/etc/sudoers
to allow a whole group of users to run any command asroot
without being prompted for a password. There are some adverse security implications of doing this--any program can perform actions as root without you being notified!--but an actual attacker, with the ability to run programs as (non-root
) you, can already capture your password as you enter it forsudo
(and then runsudo
with it).