I want only root/admin to be able to shut down the system. How can I do it in GNU/Linux, specifically Ubuntu, system?
4 Answers
Generally you don't stop people with physical access to your computer from shutting it down gracefully because if you do, they'll shut it down ungracefully by pulling the plug.
-
1
-
1Agreed. That was just to prevent them from accidentally doing so. Because they are used to shutting down every other system they sit. And this particular system runs apt-cacher and so I told every user not to shutdown. Yet accidents happen.– AkilanAug 9, 2009 at 11:33
-
Normal users, i.e. ones without physical access to the system and/or root, can't shut down the system.
Once you give users physical access you have to assume that they can get full control. Shutting down is done with the power cord. Breaking in is done by booting from USB or the DVD drive.
You can remove the DVD drive, but USB is harder since that's also the keybard and mouse.
You can, of course, lock the case down, password protect the bios, epoxy the keyboard and mouse in place, and fill the extra usb plugs, etc. It does give a impression that you might not trust your users though.
You could also look into the linux terminal server project since opening a remote session will not let you do a shutdown.
remove those users from the sudoers list. i.e. /etc/sudoers
for reference see http://nixcraft.com/linux-software/12261-etc-sudoers-file.html[link text][1]
-
2Removing users from sudoers won't stop them from shutting down the system. The normal system shutdown is communicated through xdm/gdm/kdm, which already have root privileges.– JulianoAug 3, 2009 at 13:41
-