how to disable shutdown button or option for non root users
Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
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)
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..
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.
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)
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.