Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I want only root/admin to be able to shut down the system. How can I do it in GNU/Linux, specifically Ubuntu, system?

share|improve this question
add comment

4 Answers

up vote 10 down vote accepted

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

share|improve this answer
1  
Don't modern versions of Ubuntu use PolicyKit? That would be the modern, nice way to do it. –  wzzrd Aug 3 '09 at 14:42
    
Make an Answer about that, and get the rep you deserve ;-) –  Kyle Brandt Aug 3 '09 at 14:45
    
Its working well. :-) –  Akilan Aug 10 '09 at 16:52
add comment

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.

share|improve this answer
1  
I like this answer better :-) –  Kyle Brandt Aug 3 '09 at 11:23
    
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 '09 at 11:33
add comment

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.

share|improve this answer
add comment

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]

share|improve this answer
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 '09 at 13:41
    
Yes. That won't help. –  Akilan Aug 9 '09 at 11:36
add comment

protected by Iain Jun 26 '12 at 17:31

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

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