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 06-10-2004, 10:25 AM   #1
JustinCoyan
Member
 
Registered: May 2004
Posts: 76

Rep: Reputation: 15
Can't shutdown as any user but root?


I'm sure there's a way, but from a command line it won't let me shutdown or reboot as any user but root. Do I really have to logout/login as root just to restart my machine?
 
Old 06-10-2004, 11:27 AM   #2
KMcD
Member
 
Registered: Jun 2003
Location: Dublin, Ireland
Distribution: Slack -- current
Posts: 354

Rep: Reputation: 30
you could just use "su" and then shutdown/reboot.
 
Old 06-10-2004, 11:34 AM   #3
twy
Member
 
Registered: Jun 2004
Distribution: Slackware64
Posts: 99

Rep: Reputation: Disabled
You can make your computer halt or reboot using ctrl-alt-del as any user or you can restrict it so that only root or /etc/shutdown.allow users can do it.

To allow any console user to do this, make a line in /etc/inittab like this:

ca::ctrlaltdel:/sbin/shutdown -t5 -h now

-t5 makes init wait 5 seconds for processes to terminate before killing them.
-h halts the system, but does not reboot. When the system is halted, another ctrl-alt-del will reboot.

To restrict the users that can use ctrl-alt-del, make the shutdown.allow file with a username per line and add "-a" to the shutdown command. If -a is added but no shutdown.allow file exists, only root and do the ctrl-alt-del.

See:

man ctrlaltdel
man shutdown
man init
man inittab

I find this config good. When in KDE, ctrl-alt-del brings up the logout dialog box to confirm logout with alt-l. Then wait a few seconds and do another ctrl-alt-del to halt. After waiting, the system is halted and another ctrl-alt-del reboots, or you can power down. It is useful when your video system crashes and you can't see what you are doing.
 
Old 06-10-2004, 12:07 PM   #4
Toth
Member
 
Registered: Aug 2003
Posts: 83

Rep: Reputation: 15
You can also setup sudo so as a user you'd only have to type 'sudo halt'. If you use GDM or KDM you can setup both to allow users to shut down the system.
 
Old 06-10-2004, 01:05 PM   #5
ringwraith
Senior Member
 
Registered: Sep 2003
Location: Indiana
Distribution: Slackware 15.0
Posts: 1,272

Rep: Reputation: 65
as root
chmod a+s /sbin/halt
chmod a+s /sbin/reboot
 
  


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
shutdown with a not root user krusty_lab AIX 2 10-18-2005 06:07 PM
Root User freezes on logout or shutdown grizzlyaka Linux - Laptop and Netbook 2 04-27-2005 08:20 AM
I want to grant 'shutdown' previlege to a non-root user to do directly from console jagadee76 Linux - General 6 12-29-2004 03:16 AM
Shutdown Gnome Menu for non-root user? schmmd Linux - General 4 03-10-2004 09:49 PM
how to allow a not root user to shutdown ethanchic Linux - General 9 06-18-2002 05:08 AM

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

All times are GMT -5. The time now is 05:58 AM.

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