8

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 4

10

This is generally the norm for most systems, but Ubuntu is a bit different. Here is an article with all the steps for Ubuntu.

3
  • 1
    Don't modern versions of Ubuntu use PolicyKit? That would be the modern, nice way to do it.
    – wzzrd
    Aug 3, 2009 at 14:42
  • Make an Answer about that, and get the rep you deserve ;-) Aug 3, 2009 at 14:45
  • Its working well. :-)
    – Akilan
    Aug 10, 2009 at 16:52
13

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.

3
  • 1
    I like this answer better :-) Aug 3, 2009 at 11:23
  • 1
    Agreed. 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.
    – Akilan
    Aug 9, 2009 at 11:33
  • Where does the question state that users have physical access?
    – crobar
    Apr 4 at 10:34
2

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.

0

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]

2
  • 2
    Removing 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.
    – Juliano
    Aug 3, 2009 at 13:41
  • Yes. That won't help.
    – Akilan
    Aug 9, 2009 at 11:36

Not the answer you're looking for? Browse other questions tagged or ask your own question.