5.4. Bypassing Password Authentication in sudo

Problem

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

Solution

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

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

Discussion

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 books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.