LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   enabling poweroff/reboot for user (http://www.linuxquestions.org/questions/slackware-14/enabling-poweroff-reboot-for-user-265551/)

YBA^[x] 12-12-2004 10:57 AM

enabling poweroff/reboot for user
 
Hey.

How do I enable poweroff and reboot for users?

Regards.

mdarby 12-12-2004 11:11 AM

check out the sudo command

YBA^[x] 12-12-2004 11:33 AM

Sweet. Thanks a bunch.

YBA^[x] 12-12-2004 02:51 PM

I'm having some issues with it. I've added this to sudoers:

yourusername yourhostname = NOPASSWD: /sbin/reboot, /sbin/halt -h now, /sbin/halt

This ought to enable me to use commands as reboot and poweroff as a user, right? Or am I wrong? Wether or not, they do not work. I get an "command not found". Using /sbin/halt works, though.... Did I miss anything?

Regards.

mdarby 12-12-2004 02:57 PM

;)

I'm not sure, I've never allowed any user shutdown my servers!

Cedrik 12-12-2004 04:34 PM

You have to add /sbin in your path, maybe in your ~/.bashrc file or put an alias in it, like

alias reboot="/sbin/reboot"

Ipolit 12-12-2004 04:37 PM

never worked for me too.
chmod 777 /sbin/reboot too

YBA^[x] 12-12-2004 04:57 PM

How do I add to the path?

Cedrik 12-12-2004 05:17 PM

~/.bashrc

PATH=$PATH:/sbin

# another solution :
alias reboot="sudo /sbin/reboot"

SlackerLX 12-12-2004 05:30 PM

if god's command "chmod 777" does not work there is always the dark side which I personally like, cause it worked for me
chmod 666
:jawa:

ringwraith 12-12-2004 10:28 PM

chmod +s /sbin/halt

YBA^[x] 12-13-2004 03:04 AM

Thanks a lot to all of you. After adding /sbin to the path and chmod +s /sbin/halt, it finally works.

Regards.


All times are GMT -5. The time now is 09:52 PM.