You are not logged in.

#1 2010-06-04 10:06:51

Noble
Member
Registered: 2010-06-01
Posts: 63

[SOLVED] User in power group unable to shut down or reboot computer

I've added my user to the power group using gpasswd, logged in and out multiple times. However I still need to su to root in order to init 6 or poweroff.

Am I missing something obvious?

Cheers!

Last edited by Noble (2010-06-04 23:08:24)


Those who give up their liberty for security,
neither deserve liberty nor freedom,
and they will lose both.
- Benjamin Franklin

Offline

#2 2010-06-04 10:21:59

byte
Member
From: Düsseldorf (DE)
Registered: 2006-05-01
Posts: 2,046

Re: [SOLVED] User in power group unable to shut down or reboot computer

As far as I know, the power group is only used indirectly by hal. Normal shutdown commands don't use it.


1000

Offline

#3 2010-06-04 10:31:42

Barrucadu
Member
From: York, England
Registered: 2008-03-30
Posts: 1,158
Website

Re: [SOLVED] User in power group unable to shut down or reboot computer

Yes, IIRC that's the case. I have these three lines in my sudoers file to allow passwordless shutdown/reboots:

%power ALL= (ALL) NOPASSWD: /sbin/shutdown
%power ALL= (ALL) NOPASSWD: /sbin/reboot
%power ALL= (ALL) NOPASSWD: /sbin/halt

Offline

#4 2010-06-04 13:20:30

Noble
Member
Registered: 2010-06-01
Posts: 63

Re: [SOLVED] User in power group unable to shut down or reboot computer

byte wrote:

As far as I know, the power group is only used indirectly by hal. Normal shutdown commands don't use it.

That explains it since I'm not using HAL.


Those who give up their liberty for security,
neither deserve liberty nor freedom,
and they will lose both.
- Benjamin Franklin

Offline

#5 2010-06-04 15:34:48

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

Re: [SOLVED] User in power group unable to shut down or reboot computer

you might just want to use your wheel group. I actually  have my user set up for power options instead of a group because I like to keep permissions at the leaves rather than nodes and also because I am the only user of my computer.

inxs (ALL)=ALL NOPASSWD: /sbin/shutdown, /sbin/reboot

in sudoers

and I had read somewhere (way back when) that halt in turn uses /sbin/shutdown (or maybe it was the other way round) So i don't think we need to put both in.

I also have aliases in my .aliases file for the commands

alias on='sudo reboot'  
alias off='sudo shutdown -h now'.

That way I dont have to type the entire command either.

Last edited by Inxsible (2010-06-04 15:45:56)


Forum Rules

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

Offline

#6 2010-06-04 23:08:00

Noble
Member
Registered: 2010-06-01
Posts: 63

Re: [SOLVED] User in power group unable to shut down or reboot computer

Thanks for your input guys, solved smile


Those who give up their liberty for security,
neither deserve liberty nor freedom,
and they will lose both.
- Benjamin Franklin

Offline

Board footer

Powered by FluxBB