4

Safely execute custom script parts as sudo

view full story
linux-howto

http://serverfault.com – In /usr/local/bin I've the following script called sdown /usr/local/bin$ cat sdown #!/bin/bash if [ $# -lt 1 ]; then echo "no time set" else sudo shutdown -h $1 fi Permssions are 788: -rwxr-xr-- user user sdown The point is if I run the script it's prompting for the sudo password: /usr/local/bin$ sdown 13:37 [sudo] password for user: Just to make my life even better I'd like to avoid typing in my password for shutting down the computer. I think there're to possibilities I could look for: Allowing execution of the shutdown command without prompting for sudo rights. (sudoers fil (HowTos)