LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 03-06-2008, 05:11 AM   #1
zoran119
Member
 
Registered: Dec 2007
Posts: 217

Rep: Reputation: 18
Shutdown


Hi all,

I am running Slackware 12 and would like to be able to shutdown my system from fluxbox. Issuing shutdown -h now as user zoran does not let me shutdown the machine (you are not root message).

My idea was to add myself to /etc/sudoers to allow me to shutdown with no password, but I am not sure if this is the way it should be done. How come the system can be shutdown from the login screen with no password? I remember on Ubuntu you couldn't use shutdown command (you are not root message) but from GNOME menu you could shutdown with no password.

I'm a bit confused. What is the best way to shutdown the machine with no password from the shell in fluxbox?

Thank you
 
Old 03-06-2008, 05:33 AM   #2
Libra RHR
Member
 
Registered: Aug 2003
Location: Salzburg, Austria
Distribution: Ubuntu 8.04
Posts: 46

Rep: Reputation: 15
The command

poweroff

should do it.
 
Old 03-06-2008, 05:37 AM   #3
ajef101272
LQ Newbie
 
Registered: Apr 2006
Location: Melbourne, Australia
Distribution: Gentoo
Posts: 17

Rep: Reputation: 0
The permissions on the /sbin/shutdown file should look something like this:
-rwxr-xr-x 1 root root 23128 Dec 28 11:01 /sbin/shutdown
If they don't change the permissions so that at least the user zoran can execute the shutdown command. Also look at this site
 
Old 03-06-2008, 07:00 AM   #4
dracolich
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 1,274

Rep: Reputation: 63
Add your user to /etc/sudoers for the shutdown command. Mine looks like this to allow shutdown and reboot
Code:
dracolich  COMP1=(root)  NOPASSWD: /sbin/shutdown -h now
dracolich  COMP1=(root)  NOPASSWD: /sbin/shutdown -r now
COMP1 is the computer's hostname, so substitute yours in place of COMP1.

Another way, if you don't mind typing root's password:
Code:
xterm -e su -c /sbin/shutdown -h now
 
Old 03-06-2008, 12:45 PM   #5
JMJ_coder
Member
 
Registered: Apr 2006
Distribution: Fedora
Posts: 478

Rep: Reputation: 30
Hello,

You should modify your /etc/sudoers file to include:

Code:
%users localhost=NOPASSWORD:/sbin/poweroff, /sbin/reboot
You can change %users (which allows all users) to just zoran (which would only allow zoran to issue these commands). This would then change to:

Code:
zoran localhost=NOPASSWORD:/sbin/poweroff, /sbin/reboot
Also, localhost should be set to whatever your computer is called.

If you want to issue these commands from the Flux Menu instead of having to open a term window every time you to shutdown or reboot (a nice feature) - add this to your ~/.fluxbox/menu:

Code:
[exec] (Reboot) {sudo /sbin/reboot}
[exec] (Shutdown) {sudo /sbin/poweroff}
 
Old 03-09-2008, 04:09 AM   #6
zoran119
Member
 
Registered: Dec 2007
Posts: 217

Original Poster
Rep: Reputation: 18
Sudo helped out

Code:
zoran vulcan=(root) NOPASSWD:/sbin/shutdown
Thank you very much!
 
  


Reply



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
My Linux box does not shutdown i do when i do /sbin/shutdown -h now yawe_frek Linux - Hardware 6 09-14-2007 07:48 AM
Please help on how to save services shutdown or shutdown from the terminal. wambuzz Linux - General 2 03-11-2005 07:38 AM
Linux full shutdown vs. manual shutdown? LQtoto Linux - General 9 01-26-2005 06:21 PM
unable to 'shutdown' from x... need to shutdown using 'halt' guitarnix Linux - Newbie 5 11-24-2003 01:00 AM
konsole shutdown possible? or key combo = shutdown possible? Laptop2250 Linux - Newbie 3 11-16-2003 10:44 AM

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

All times are GMT -5. The time now is 07:14 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