How to Disable the Ubuntu ‘Suspend’ Button (Remove from Power Menu)

When you click the system menu (the battery/network/volume cluster) in the top-right corner of Ubuntu, you are presented with a power menu containing options for Power Off, Restart, and Suspend. The Suspend button puts your computer into a low-power sleep state.

If you are configuring a computer to act as a home server, a media center, or a kiosk, you never want that machine to go to sleep. Even worse, if you accidentally click Suspend via remote desktop on a headless server, you will completely lose access to the machine until you physically walk over to it and press the power button. To prevent accidental sleep states, you can completely remove the Suspend button from the GNOME power menu.

How to Remove the Suspend Button in Ubuntu

You must use the gsettings command-line tool to modify the GNOME shell’s power policies.

  1. Open your application grid and launch the Terminal (or press Ctrl + Alt + T).
  2. To completely disable the suspend feature, you must mask the systemd target. Type the following command and press Enter: sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
  3. Type your administrator password when prompted. (This tells the underlying operating system that sleep states are forbidden).
  4. To visually remove the button from the menu, you must restart the GNOME shell. The safest way to do this is to completely reboot your computer: sudo reboot

When your machine boots back up, click the system menu in the top right. The Suspend button will be completely absent from the power options. It is now impossible for you, or any other user, to accidentally put the machine to sleep via the graphical interface.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.