We have a computer running elementary OS Loki. Several users have access to this computer and there are usually two or more GUI sessions open at the same time.

The problem is that any user can shutdown or reboot the computer even when other sessions are open. There is no warning, just the default confirmation dialog.

In this situation, I have read that the default behavior in Ubuntu is to log the user out without shutting down. How can we get a similar behavior in elementary?

1 Answer 1


I'm not sure if there's a setting in elementaryOS for this specifically, but you can accomplish this by creating a systemd-inhibit startup command that blocks shutdown from happening so long as it's running (as long as the user is logged in). The only downside to this is that if it's running and you want to shutdown from your user, you can't without killing it. I'll explain how.

In the System Settings, click on "Applications" and then the "Startup" tab. Click the small plus sign towards the bottom left and in the custom command entry box at the bottom of the small dialog that's now appeared, enter the following.

systemd-inhibit --what=shutdown --mode=block sleep infinity

Once that's added to the list, log out and log back in. Then try logging into another account and try to shutdown. If all goes well, nothing should happen. You will need to add this to each account you want to keep from being shutdown unfortunately. If you do want to override this, you can run killall sleep in the terminal and then shutdown should function normally from then on.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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