Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

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'm using a desktop as both a router for my local network and as a normal desktop with multiple users. I have Maverick running on it. Occasionally, one of the desktop users will accidentally press Shutdown, Restart, Suspend, or Hibernate, leading to me having to fix the network at random times of day. I know how to restart and shutdown from the command line. I do not need the GUI interface.

How can I remove the Shutdown, Suspend, Restart, and Hibernate options form the user switcher menu? All the I want left is the "Lock Screen", "Guest Session", List of users and "Logout" left.

A system wide solution would be best, but I can do one on each user if necessary.

share|improve this question
If you do find away to just take those options out of the gui . Then it would cure your issue. But It will be very tedious and risky. What i would be afraid of is making this change and leaving the system unable to restart even from the command prompt. – freebird Jul 16 '11 at 6:34
@freebird I'm sorry but I can't agree with your comment. A GUI option to shutdown isn't mandatory. Servers, mostly, don't run a desktop env like GNOME and can restart at will – sergio91pt Jul 16 '11 at 9:21
up vote 3 down vote accepted

Option 1:

Install gconf-editor, run gksu gconf-editor and on /apps/indicator-session/ supress the restart and shutdown.

I'm not sure about suspend and hibernate, maybe changing <allow_active> to no on /usr/share/polkit-1/actions/org.freedesktop.upower.policy will do the trick.

Option 2:

Remove the Indicator session package and add desktop shortcuts to logout and locking the screen.

The command to logout is gnome-session-save --logout-dialog and to lock the screen use gnome-screensaver-command --lock.

share|improve this answer
The first option works. I'm not sure if you can still suspend or hibernate from the CLI with it, but that doesn't really matter on this machine. Thanks! – Azendale Jul 16 '11 at 16:49

For suspend and hibernate, instead of editing a package file that will be replaced when the package is updated, one can use files in /etc/polkit-1/localauthority. Disable suspend with the file /etc/polkit-1/localauthority/90-mandatory.d/disable-suspend.pkla containing :

[Disable suspend]

This is inspired by the file /var/lib/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla containing, among other things, the configuration to disable hibernation :

[Disable hibernate by default]

At least, it's what I use on Ubuntu 12.04.

More on PolicyKit local authority:

share|improve this answer
Does not work in 13.10 – Takkat Mar 30 '14 at 11:03

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.