February 2020
Intermediate to advanced
666 pages
15h 45m
English
So, what if a user has written a shell script that requires sudo privileges? To answer that, let's have Frank create the frank_script.sh shell script that looks like this:
#!/bin/bashecho "This script belongs to Frank the Cat."
Okay, he wouldn't need sudo privileges for that, but let's pretend that he does. After he sets the executable permission and runs it with sudo, the output will look like this:
frank@packtpub1:~$ sudo ./frank_script.sh [sudo] password for frank: Sorry, user frank is not allowed to execute './frank_script.sh' as root on packtpub1.tds. frank@packtpub1:~$
So, naturally frustrated, Frank requested that I create a sudo rule so that he can run the script. So, I open visudo and add ...