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@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@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20100730104304.GA12112@fantasio.champignac">http://lists.debian.org/20100730104304.GA12112@fantasio.champignac
07-30-2010, 11:02 AM
Rob Owens
my (simple) sudoers doesn't work
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@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20100730110225.GA3409@aurora.owens.net">http://lists.debian.org/20100730110225.GA3409@aurora.owens.net