LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-12-2004, 09:57 AM   #1
YBA^[x]
Member
 
Registered: Apr 2004
Location: Denmark
Distribution: Slackware 10.2
Posts: 121

Rep: Reputation: 15
enabling poweroff/reboot for user


Hey.

How do I enable poweroff and reboot for users?

Regards.
 
Old 12-12-2004, 10:11 AM   #2
mdarby
Member
 
Registered: Nov 2004
Location: Columbus, Ohio
Distribution: Slackware-Current / Debian
Posts: 795

Rep: Reputation: 30
check out the sudo command
 
Old 12-12-2004, 10:33 AM   #3
YBA^[x]
Member
 
Registered: Apr 2004
Location: Denmark
Distribution: Slackware 10.2
Posts: 121

Original Poster
Rep: Reputation: 15
Sweet. Thanks a bunch.
 
Old 12-12-2004, 01:51 PM   #4
YBA^[x]
Member
 
Registered: Apr 2004
Location: Denmark
Distribution: Slackware 10.2
Posts: 121

Original Poster
Rep: Reputation: 15
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.
 
Old 12-12-2004, 01:57 PM   #5
mdarby
Member
 
Registered: Nov 2004
Location: Columbus, Ohio
Distribution: Slackware-Current / Debian
Posts: 795

Rep: Reputation: 30


I'm not sure, I've never allowed any user shutdown my servers!
 
Old 12-12-2004, 03:34 PM   #6
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

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

alias reboot="/sbin/reboot"

Last edited by Cedrik; 12-12-2004 at 03:38 PM.
 
Old 12-12-2004, 03:37 PM   #7
Ipolit
Member
 
Registered: Nov 2003
Location: Bulgaria
Distribution: Vector Linux, Morphix
Posts: 321

Rep: Reputation: 33
never worked for me too.
chmod 777 /sbin/reboot too
 
Old 12-12-2004, 03:57 PM   #8
YBA^[x]
Member
 
Registered: Apr 2004
Location: Denmark
Distribution: Slackware 10.2
Posts: 121

Original Poster
Rep: Reputation: 15
How do I add to the path?
 
Old 12-12-2004, 04:17 PM   #9
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 244Reputation: 244Reputation: 244
~/.bashrc

PATH=$PATH:/sbin

# another solution :
alias reboot="sudo /sbin/reboot"
 
Old 12-12-2004, 04:30 PM   #10
SlackerLX
Senior Member
 
Registered: Dec 2004
Location: Herzliyya, Israel
Distribution: SuSE 10.1; Testing Distros
Posts: 1,832

Rep: Reputation: 47
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
 
Old 12-12-2004, 09:28 PM   #11
ringwraith
Senior Member
 
Registered: Sep 2003
Location: Indiana
Distribution: Slackware 15.0
Posts: 1,272

Rep: Reputation: 65
chmod +s /sbin/halt
 
Old 12-13-2004, 02:04 AM   #12
YBA^[x]
Member
 
Registered: Apr 2004
Location: Denmark
Distribution: Slackware 10.2
Posts: 121

Original Poster
Rep: Reputation: 15
Thanks a lot to all of you. After adding /sbin to the path and chmod +s /sbin/halt, it finally works.

Regards.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
reboot/poweroff how? demmylls Linux - General 2 08-13-2009 09:52 AM
reboot vs poweroff??? bigdog0007 Linux - Newbie 4 09-16-2005 02:48 AM
poweroff reboot launcher for xfce w/ KDM? r_jensen11 Linux - Software 2 01-17-2004 04:00 PM
KDM+XFCE+Logout/poweroff/reboot menu? r_jensen11 Linux - Software 0 01-04-2004 06:46 PM
SuSE 8.2 Will Not Poweroff, Shutdown, Reboot, Halt... whiskeypriest Linux - Newbie 4 09-18-2003 09:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration