Disable Shutdown For Normal Users March 20, 2006Posted by Carthik in administration, guides, ubuntu.
Sometimes, when you have one computer shared among multiple users, and you don’t want normal users (users who are not admins), that is, anyone who is not you 😉 to be able to shutdown the computer, then you can follow the following steps. Some of this is from the useful fedora mailing list email, and some from the ubuntu-users mailing list (thanks to Olafur Arason). I tried the instructions below on my computer, and this should work for you.
Again, this will allow only admin users with sudo privileges to shutdown the computer, for other “normal” users, the logout menu will allow them to do only that, log out!
/etc/X11/gdm/gdm.conf in a text editor and find the [greeter] section. Make sure that there is a line which says
SystemMenu = false. This line will ensure that the gdm login screen will not have the option for shutting down the system etc.
If you have a laptop, or an acpi system on your computer, then go to
/etc/acpi and disable the power button, so that, when someone presses the power button, the system does not shutdown. You can disable this easily by doing
chmod 000 /etc/acpi/powerbtn.sh
and find the lines that say:
ca::ctrlaltdel:/sbin/shutdown -t3 -r now
And change it to read:
ca::ctrlaltdel:/bin/echo "ctrl-alt-delete has been disabled"
This will effectively prevent users from changing to a console screen and using ctrl+alt+delete to shutdown the system.
Execute the following commands:
sudo chgrp admin /sbin/halt /sbin/shutdown
sudo chmod 550 /sbin/halt /sbin/shutdown
Use the Configuration Editor (Applications -> System Tools -> Configuration Editor) to edit the preference apps->gnome-session->options->logout_option to “logout” instead of “shutdown”.
That’s it! Now only you, or another superuser (Admin) can shutdown the system, using the command:
$sudo shutdown -t3 -r now