5.4. Bypassing Password Authentication in sudo


You want one user to run a command as another user without supplying a password.


Use sudo’s NOPASSWD tag, which indicates to sudo that no password is needed for authentication:

smith  ALL = (jones) NOPASSWD: /usr/local/bin/mycommand args
smith  ALL = (root) NOPASSWD: /usr/local/bin/my_batch_script ""


By not requiring a password, you are trading security for ...

Get Linux Security Cookbook now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.