Disabling shutdown command for all users, even root - consequences?

Posted by Rich on Ask Ubuntu See other posts from Ask Ubuntu or by Rich
Published on 2010-12-13T09:08:37Z Indexed on 2011/03/19 8:18 UTC
Read the original article Hit count: 282

Filed under:
|
|

I would like to disable the shutdown command for all users, even root, on an Ubuntu Server installation.

The reason I want to do this is to ensure that I don't get into the habit of shutting down the machine in this way, as I SSH into a lot of production machines at the same time as this one, and I don't want to accidentally shutdown one of the other machines by typing the command into the wrong window.

The server I want do disable shutdown on only runs inside VirtualBox on my Windows desktop, and I only use it for local testing so it is not a problem if I can't shut it down from the command line.

I have already mitigated the problem a bit by ensuring I have a different password on the VirtualBox image, but obviously if I am within the sudo 'window' on one of the production machines, I could still accidentally shut it down.

My questions are:

  1. How do I disable the shutdown command?
  2. If I do disable the shutdown command, are there any consequences that I should be made aware of? Most specifically, will it disable support for ACPI shutdown that is the equivalent of pressing the power button on a physical machine? Could it affect other generic applications?

For information, I just use this VirtualBox image for trying out shell scripts, running Tomcat and Java, and that kind of thing.

© Ask Ubuntu or respective owner

Related posts about shutdown

Related posts about root