On Ubuntu 18.04, the computer suspends when pressing the power button and no user is logged on it (this behaviour is different when a user is logged in)

I've found https://askubuntu.com/a/362931/30535 but it doesn't work in my case.

Tried also to set dconf key as https://askubuntu.com/a/892108/30535 with value 'nothing' ... but this seems to be user specific, not system wide.

How could we set that the OS to ask what to do when power button is pressed? (or at least don't do anything?)

1 Answer 1


The gsettings solution to edit a dconf key was the right one, but it has to be done as gdm user (Since it's that user that take care of what to do when no user is logged in).

sudo su -s /bin/bash gdm
gsettings set org.gnome.settings-daemon.plugins.power power-button-action 'interactive'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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