LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
LinkBack Search this Thread
Old 09-09-2009, 03:19 AM   #1
ankurpachauri
LQ Newbie
 
Registered: Jun 2009
Posts: 5

Rep: Reputation: 0
how to disable shutdown button or option for non root users


hi all i am using fedora 7. i want that, users other than root should not be able to shutdown the system,
i had already changed the mode of /sbin/shutdown to -rwxr-w--(750)
 
Old 09-09-2009, 07:22 AM   #2
cardy
Member
 
Registered: Jan 2005
Location: Shropshire, England, UK
Distribution: RedHat, Fedora, CentOS..........
Posts: 121

Rep: Reputation: 19
The proper way would be to use the /etc/shutdown.allow file to list those users who are allowed to run the shutdown command.

The article at this URL http://www.spencerstirling.com/compu.../shutdown.html gives a pretty good explanation of how to set it up.
 
Old 09-09-2009, 09:12 PM   #3
dissident85
LQ Newbie
 
Registered: Oct 2008
Posts: 29

Rep: Reputation: 16
I may be wrong, but isn't it possible to just hold down the button for a few seconds and regardless of what you have set in the OS it will power off the box? So it would be kind of impossible to stop a non root user from shutting it down? well they could always just pull the power plug.. lol..
 
Old 09-09-2009, 11:07 PM   #4
lumak
Member
 
Registered: Aug 2008
Location: Phoenix
Distribution: Arch
Posts: 799
Blog Entries: 32

Rep: Reputation: 109Reputation: 109
Disable press and hold shutdown in the bios. Then remove the appropriate lines from the pm utile configuration in /etc. root will Not have the convenience of pressing the power button to shutdown. But your system will be safe from the other users. I believe the power button is tracked by a system process or kernel event and is therefore user Independent.
 
Old 09-09-2009, 11:13 PM   #5
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542
As far as the power button goes, I've never seen a BIOS option to disable it from shutting the machine off one way or another (though that would be cool); common default press+release options are "4-second delay" and "Instant-off" and "suspend/hibernate", but all these don't change the result of holding the button in for 4 seconds: it will shut off. I believe it's hard-wired to do this, like the reset button is hard-wired. The ACPI control methods only seem to work for the press+release function, not the press+hold function.

The best way to hard-disable the button is to disconnect it (with obvious non-handy spin-off effects)

Sasha
 
Old 09-10-2009, 05:30 AM   #6
cardy
Member
 
Registered: Jan 2005
Location: Shropshire, England, UK
Distribution: RedHat, Fedora, CentOS..........
Posts: 121

Rep: Reputation: 19
The above is correct in that the power off (holding for 4 seconds) is usually hard wired into the hardware, either way it would not stop a determined user from simply pulling the power cable, the instructions above would limit the users who can run shutdown. The CTRL+ALT+DEL combination is caught by the init process, the following line

Quote:
# Trap CTRL-ALT-DELETE
ca::ctrlaltdel:/sbin/shutdown -t3 -r now
in /etc/inittab traps the CTRL+ALT+DEL press and determines what the OS should do with it.
 
  


Reply

Tags
disable, root, shutdown


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 On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I disable "shutdown" and "restart" options in KDE logout screen for all users? maxgsp Linux - Distributions 1 12-12-2008 03:18 PM
disable shutdown by press the power button nickraj General 8 03-02-2007 11:16 PM
SuSE 9.3 - USB Diapeared & Non-Root users can shutdown system nuro305 Suse/Novell 9 04-14-2006 02:27 PM
Disable viewing root directory for users gellings Linux - Security 1 04-10-2006 10:34 AM
allowing non-root users to mount drives and shutdown rlpt Slackware 3 09-21-2002 06:35 PM


All times are GMT -5. The time now is 11:29 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration