Archive for September, 2009

Adding a command to sudoers without password(NOPASSWD)

September 7th, 2009

I had to allow an user to run rysnc without prompting password for ’sudo’. I wasted a lot of time on this since the syntax was not not mentioned properly on the examples shown on /etc/sudoers file. So I wanna share this with you to save your time.

In case if you want to allow user ‘anoop’ to run ‘rsync’ command without prompting password. Add the following entry at the end of /etc/sudoers (better use the command ‘visudo’ that alerts on syntax errors)

anoop ALL = NOPASSWD: /usr/bin/rsync

You may add more commands seperated with commas, like : anoop ALL = NOPASSWD: /usr/bin/rsync , /PATH/to/some-other-command.

Hope this will be helpful for some one.
_^_

Retweet this post