Sometimes the need arises to run a script as root. Instead of embedding a su/sudo command in the script, it's better practice to modify the /etc/sudoers file and include the specific rights.
#Custom setup
Cmnd_Alias MYBOX = /home/johnDoe/mybox
# johnDoe can run any commands in the MYBOX directory.
johnDoe ALL = MYBOX
Examples can be found here
No comments:
Post a Comment