How to run a specific program as root without a password prompt?
I installed fedora 15. I use
sudo visudo to modify sudoers file and add the following line:
USERNAME ALL=(ALL) NOPASSWD: ALL
I then logout and login. I try doing any sudo command like
sudo gvim &... but I am still getting prompted for password.
How do you get NOPASSWD sudo option to work in Fedora 15?
- Is my syntax wrong?
- Is there some Fedora 15 thing that is preventing this to work?
After seeing answers below talking about "the order of your sudoers file" I decided to copy the full sudoers file in here. I took the liberty of removing most white space lines, all comments lines, and all lines containing the string "Default":
root ALL=(ALL) ALL USERNAME ALL=NOPASSWD:ALL,/bin/mount,/bin/umount %wheel ALL=(ALL) ALL