LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux > Linux - General
User Name
Password
Linux - General This 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

Tags used in this thread
Popular LQ Tags , , , ,

Reply
 
Thread Tools
Old 09-09-2009, 04:19 AM   #1
ankurpachauri
LQ Newbie
 
Registered: Jun 2009
Posts: 5
Thanked: 0
how to disable shutdown button or option for non root users


[Log in to get rid of this advertisement]
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)
linuxfedora ankurpachauri is offline  
Tag This Post , , , ,
Reply With Quote
Old 09-09-2009, 08:22 AM   #2
cardy
Member
 
Registered: Jan 2005
Location: Shropshire, England, UK
Distribution: RedHat, Fedora, CentOS..........
Posts: 90
Thanked: 4
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.
linuxfedora cardy is offline     Reply With Quote
Old 09-09-2009, 10:12 PM   #3
dissident85
LQ Newbie
 
Registered: Oct 2008
Posts: 22
Thanked: 1
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..
windows_xp_2003 dissident85 is offline     Reply With Quote
Old 09-10-2009, 12:07 AM   #4
lumak
Member
 
Registered: Aug 2008
Location: Phoenix
Distribution: Slackware64
Posts: 361
Blog Entries: 19
Thanked: 24
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.
windows_xp_2003 lumak is offline     Reply With Quote
Old 09-10-2009, 12:13 AM   #5
GrapefruiTgirl
Moderator
 
Registered: Dec 2006
Location: N.S.
Distribution: Slackware64
Posts: 4,236
Thanked: 180
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
linuxslackware GrapefruiTgirl is offline     Reply With Quote
Old 09-10-2009, 06:30 AM   #6
cardy
Member
 
Registered: Jan 2005
Location: Shropshire, England, UK
Distribution: RedHat, Fedora, CentOS..........
Posts: 90
Thanked: 4
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.
linuxfedora cardy is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

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


All times are GMT -5. The time now is 04:24 PM.

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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration