This content has been marked as final. Show 2 replies
Sudo means to run a command as root.
To allow a user to execute a particular command as root, you can add the following to the /etc/sudoers configuration:
Syntax: username hostname=command
username = name of the user according to /etc/passwd
hostname = The hostname of the system where this rule applies.
command = command to execute
[dude@vm014 ~]$ /etc/init.d/sendmail restart rm: cannot remove `/var/run/sm-client.pid': Permission denied Shutting down sendmail: /etc/rc.d/init.d/functions: line 141: /var/run/sendmail.pid: Permission denied rm: cannot remove `/var/run/sendmail.pid': Permission denied Starting sendmail: /etc/rc.d/init.d/functions: line 141: /var/run/sendmail.pid: Permission denied 550 Permission denied (real uid not trusted)
su - root visudo dude vm014=/etc/init.d/sendmail restart
[dude@vm014 ~]$ sudo /etc/init.d/sendmail restart [sudo] password for dude: Shutting down sm-client: [ OK ] Shutting down sendmail: [ OK ] Starting sendmail: [ OK ] Starting sm-client: [ OK ]