Prevent PC from shutting down on Power button

I am building a PC and a BeagleBords ARM embedded for public use. They run Ubuntu 13.04 and manually assembled Linux respectively. Is there a way to prevent them from being shut down on pressing Shutdown button (on case, not on keyboard)? Sure, I can do it in hardware. I just prefer software solutions. If somebody can say for sure "this is impossible" it would be a useful answer too.

Result: Ok, I understood it. One can prevent shutdown on press, but not on long press. I will have to make hardware switch to plug off Power button when needed.


You can use next command in terminal:

sudo chmod -x /sbin/shutdown

If you want to re-enable, use +x instead -x in the same command.

Anyway, by holding the power button down for several seconds the above solution will not work and I don't think that you will find a software solution for this case.


It is impossible. You need to physically keep the public away from the power switch, just as you need to prevent them from yanking the power cord from the wall, or grabbing the whole machine and running off with it.