You are not logged in.

#1 2011-03-12 20:11:22

Lowra
Member
Registered: 2009-09-21
Posts: 192

[SOLVED] Allowing users to halt computer with sudo without password

Hi Archers.

First of all, I'd like to say that I've read the Wiki page about that but this is not exactly what I want.

What I want is to allow all users to halt, and reboot my computer while they are using sudo, without asking them a password BUT only with these commands (halt and reboot). The prompt have to ask for a password for all the rest (using pacman...)

I would like to do this in a clean, and comprehensible way.

Thanks wink

Last edited by Lowra (2011-03-12 21:34:32)

Offline

#2 2011-03-12 20:14:16

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: [SOLVED] Allowing users to halt computer with sudo without password

look into visudo and allowing NOPASSWD option to reboot and poweroff commands. Its the first option listed in the link that you gave. Why do you not want to use that?


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#3 2011-03-12 20:30:28

Lowra
Member
Registered: 2009-09-21
Posts: 192

Re: [SOLVED] Allowing users to halt computer with sudo without password

The example provided in visudo will allow a user, or a group of user to execute all the commands without asking for a password. This is not what I want.

The example in the wiki does roughly what I want, but applies to only one user and one hostname.
I would like to make it applies to all the users of my system, and without defining any hostname in my /etc/sudoers. I'm writting a little guide for a couple of people, and I wouldn't like to add in it anything which depends on a custom hostname...

Offline

#4 2011-03-12 20:44:53

loafer
Member
From: the pub
Registered: 2009-04-14
Posts: 1,772

Re: [SOLVED] Allowing users to halt computer with sudo without password

I am sure you can do this with sudo but you can definately do it with super (in the AUR).

Last edited by loafer (2011-03-12 20:50:12)


All men have stood for freedom...
For freedom is the man that will turn the world upside down.
Gerrard Winstanley.

Offline

#5 2011-03-12 21:00:55

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: [SOLVED] Allowing users to halt computer with sudo without password

Lowra wrote:

The example provided in visudo will allow a user, or a group of user to execute all the commands without asking for a password. This is not what I want.

The example in the wiki does roughly what I want, but applies to only one user and one hostname.
I would like to make it applies to all the users of my system, and without defining any hostname in my /etc/sudoers. I'm writting a little guide for a couple of people, and I wouldn't like to add in it anything which depends on a custom hostname...

%somegroup ALL=ALL NOPASSWD: /sbin/halt,/sbin/reboot

Or you could use consolekit.


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#6 2011-03-12 21:05:16

skunktrader
Member
From: Brisbane, Australia
Registered: 2010-02-14
Posts: 1,543

Re: [SOLVED] Allowing users to halt computer with sudo without password

Did you try this yet?

%users ALL=NOPASSWD: /sbin/shutdown -h now,/sbin/reboot

Offline

#7 2011-03-12 21:25:42

Lowra
Member
Registered: 2009-09-21
Posts: 192

Re: [SOLVED] Allowing users to halt computer with sudo without password

Thanks Mr.Elendig, and skunktrader.

I made a mix of your anwsers, tested it, and it works well smile

%users ALL=NOPASSWD: /sbin/halt,/sbin/reboot

SOLVED !

Offline

Board footer

Powered by FluxBB