Sudo examples

From Bitbull Wiki
Jump to navigation Jump to search

If a script that has been written needs to be run as a particular user, the /etc/sudoers file needs to be modified to include default user options.

Edit the /etc/sudoers file by invoking:


In this example, SCRIPT1 is the script that will be executed. TESTUSER is the alias of users who have permission to execute the script via sudo and test is the user that the script must be run as.

Cmnd_Alias SCRIPT1=/bin/
User_Alias TESTUSER=test,test1,test2

If the sudo /bin/ command is invoked by the test, test1, or test2 users it will run as user test.