> On Fri, 11 Dec 1998, shaul wrote:
> 
> > [01:53:38 shaul]$ sudo -l
> > You may run the following commands on this host:
> >     (root) /sbin/halt
> >     (root) /sbin/shutdown -r "now"
> >     (root) /sbin/shutdown -h "now"
> > [01:55:14 shaul]$ sudo reboot
> > Sorry, user shaul is not allowed to execute "/sbin/reboot" as root on 
> > rakefet.
> 
> I'm guessing that reboot != shutdown -r "now".  Try running:
> sudo shutdown -r "now"
> 

It didn't work. Apparently my problem was the line
        Cmnd_Alias      SHUTDOWN=/sbin/shutdown -r "now"
which I assumed that will let me do what I want.

After reading your response, I changed my sudoers file. Currently, it is:

[16:57:12 shaul]# cat /etc/sudoers 
# sudoers file (/etc/sudoers).
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the man page for the details on how to write a sudoers file.
#

# Host alias specification

# User alias specification

##
# Cmnd alias specification
##
Cmnd_Alias      HALT=/sbin/halt

##
# User privilege specification
##

# root can run anything on any machine as any user
root    ALL=(ALL) ALL

# shaul may run these commands:
shaul   ALL=HALT, /sbin/shutdown -[hr] now
[16:59:15 shaul]# exit      
[17:00:53 shaul]$ sudo -l

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these two things:

        #1) Respect the privacy of others.
        #2) Think before you type.

Password: 
You may run the following commands on this host:
    (root) /sbin/halt
    (root) /sbin/shutdown -[hr] now
[17:01:56 shaul]$ 




Reply via email to