Various sudo-related tips & tricks; these should go into /etc/sudoers or /etc/sudoers.d/

# Allow all members of sudo group to execute any command w/out password prompt
%sudo ALL=NOPASSWD: ALL
# Allow members of sudo group to execute any command, and switch to another user, w/out password prompt
%sudo ALL=(ALL) NOPASSWD: ALL

# Allow one user to execute any command w/o password prompt
sjain ALL=NOPASSWD: ALL

# Allow user to execute only 1 program as root or any user, w/o password
sjain ALL=(ALL) NOPASSWD: /usr/bin/whatever

# Allow user to execute only 1 program as root or any user
sjain ALL=(ALL) /usr/bin/whatever


CategoryCheatSheet

SamatsWiki: CheatSheet/Sudo (last edited 2016-11-06 05:07:53 by SamatJain)