Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a headless linux mint machine that I use for a file server and other things. It's been working great for me for a few years, but there's one issue - my cat likes to hang out on top of it, and when she climbs off and on she occasionally steps on the power button and shuts off the machine.

Is there an easy way to change the behavior of the power button so it requires an extremely long duration press (10 seconds or so) or multiple presses in order to do anything?

share|improve this question
Is this a desktop or a laptop? I'm guessing laptop if that cat has access to the power button. – terdon Jan 10 '14 at 17:45
It's a desktop - is this actually relevant to a software solution? – schizodactyl Jan 10 '14 at 22:16
Heh. Not only do I have the the same problem, it's for exactly the same reason. To @terdon's question, it's a desktop, but the power button is on the top of the front panel facing up. It's in just the right place for a cat to put a paw on when jumping off the top of the case. – Sam Hanes Mar 28 at 20:42
If you have a reset button, it's often smaller and harder to press. If so, you can wire it up as the power button, and disconnect the actual power button. That's how I deal with my cat related power button issues :) – Roger Dahl Jun 9 at 3:14
up vote 8 down vote accepted

Well, one thing you could do is simply disable the power button altogether. Personally, I only use it to turn on my machine, and never use it once the machine is on. If this is an OK solution for you, edit /etc/acpi/events/powerbtn-acpi-support:

sudo nano /etc/acpi/events/powerbtn-acpi-support

That file should look something like this:

event=button[ /]power

To make the power button do nothing, change it to:

event=button[ /]power

Then restart the acpi daemon with

sudo service acpid restart

Your power button should no be ignored.

share|improve this answer
I'm not really comfortable disabling the button entirely as, since it's a headless machine, if sshd were to crash or something along those lines my only recourse would be to cut off power to the machine. I'd much rather still leave myself with the ability to shut down gracefully if possible. – schizodactyl Jan 10 '14 at 22:20
@schizodactyl on my laptop, the solution above disables only the single press of the power button. A long press will still shut the machine down (though not very gracefully). I don't have access to a desktop at the moment so I can't test how it would work but, presumably, it will do the same. You can also map a shortcut to the shutdown command if you have a keyboard attached. – terdon Jan 11 '14 at 2:28
Thank you very much! My kitten used to power off my computer! :) – Geradlus_RU Dec 22 '14 at 10:22

Duct-tape a cardboard guard over the button. Take three pieces of corrugated cardboard, and cut a hole in each large enough for your finger to reach through to the button. Glue them together, with the hole aligned, then duct tape the assembly around the button. All hail our feline overlords!

share|improve this answer
See: Molly-guard – jwygralak67 Jan 10 '14 at 22:00
As this is legitimately what I was considering doing if there's no good software solution, I can't really fault you for suggesting it... – schizodactyl Jan 10 '14 at 22:18
+1 for 'outside-the-box' thinking :) – jazmit Jul 9 '15 at 8:55

terdon's answer is correct in most cases, but for distributions that have adopted systemd-logind it handles power events instead of acpid. On those distributions, add or edit this setting /etc/systemd/logind.conf to disable the power button:


You'll need to reboot in order to pick up the new setting as logind can't be restarted while a desktop session is active.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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