LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   how to disable shutdown button or option for non root users (http://www.linuxquestions.org/questions/linux-general-1/how-to-disable-shutdown-button-or-option-for-non-root-users-753784/)

ankurpachauri 09-09-2009 03:19 AM

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)

cardy 09-09-2009 07:22 AM

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.

dissident85 09-09-2009 09:12 PM

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..

lumak 09-09-2009 11:07 PM

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.

GrapefruiTgirl 09-09-2009 11:13 PM

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

cardy 09-10-2009 05:30 AM

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.


All times are GMT -5. The time now is 11:42 PM.