From: Gauthier Vandemoortele on
Hello,

I wish to halt|shutdown| sleep my machine as an unprivilegied user on
the command-line or via the menu of a light window-manager.

Here's my /etc/sudoers

Defaults env_reset

# User alias specification
User_Alias STOP = gv

# Cmnd alias specification
Cmnd_Alias SLEEP = /usr/sbin/acpitool -S
Cmnd_Alias HALT = /usr/sbin/halt
Cmnd_Alias REBOOT = /usr/sbin/reboot

# User privilege specification
root ALL=(ALL) ALL

# Uncomment to allow members of group sudo to not need a password
# (Note that later entries override this, so you might need to move
# it further down)
# %sudo ALL=NOPASSWD: ALL

STOP ALL= NOPASSWD: SLEEP, HALT, REBOOT

The only thing I got to work is to insert

gv ALL=(ALL) ALL

But in all other configurations,

gv ALL = /usr/sbin/acpitool -S
gv ALL = SLEEP

the response I get is:

gv(a)fantasio:~$ sudo halt

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

#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.

[sudo] password for gv:
Sorry, user gv is not allowed to execute '/sbin/halt' as
root on fantasio.champignac.

What is the mistake ? (I use visudo and sudo 1.6.9p17-3 on Lenny)

Thanks in advance,
--
Gauthier

Les îles, c'est pas des îles,
au fond de l'eau, ça touche.
(Brèves de comptoir - J-M Gourio)


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/20100730104304.GA12112(a)fantasio.champignac
From: Rob Owens on
On Fri, Jul 30, 2010 at 12:43:04PM +0200, Gauthier Vandemoortele wrote:
> Hello,
>
> I wish to halt|shutdown| sleep my machine as an unprivilegied user on
> the command-line or via the menu of a light window-manager.
>
> Here's my /etc/sudoers
>
> Defaults env_reset
>
> # User alias specification
> User_Alias STOP = gv
>
> # Cmnd alias specification
> Cmnd_Alias SLEEP = /usr/sbin/acpitool -S
> Cmnd_Alias HALT = /usr/sbin/halt
> Cmnd_Alias REBOOT = /usr/sbin/reboot
>
Try putting a wildcard at the end. Presumably you're actually running
something like "halt now", correct? So sudoers, I think, should show
the command as "/usr/sbin/halt *"

-Rob


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/20100730110225.GA3409(a)aurora.owens.net
From: Tom H on
On Fri, Jul 30, 2010 at 6:43 AM, Gauthier Vandemoortele
<gauthier.v(a)skynet.be> wrote:
>
>    STOP ALL= NOPASSWD: SLEEP, HALT, REBOOT

The one thing that jumps at me is that you don't have a "run as" user set

STOP ALL= (root) NOPASSWD: SLEEP, HALT, REBOOT


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/AANLkTimvCkK8EJkU9xGJ_S33U7kSgw1o5wq91Wp8B2cs(a)mail.gmail.com
From: Gvdmoort on
Le ven 30 jui, Gauthier Vandemoortele m'a écrit:
> # Cmnd alias specification
> Cmnd_Alias SLEEP = /usr/sbin/acpitool -S
> Cmnd_Alias HALT = /usr/sbin/halt
> Cmnd_Alias REBOOT = /usr/sbin/reboot


I'm sorry, you can disregard this post, it was only mistakes in the
path of the command (take care of copy-paste...):

Cmnd_Alias SLEEP = /usr/bin/acpitool -S
Cmnd_Alias HALT = /sbin/halt
Cmnd_Alias REBOOT = /sbin/reboot

Regards,
--
Gauthier


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/20100731093156.GA2920(a)fantasio.champignac