Skip to content

How to disable the Ubuntu shutdown confirmation

October 15th, 2023 Ubuntu A close up of a power button

Some users, including me, find the built-in shutdown confirmation dialog a bit of an annoyance. This dialog is designed to prevent accidental shutdowns, but if you're confident in your actions and want to streamline the shutdown process, you can easily disable it. I’ll show you how to do it in two different ways, with gsettings or with the dconf Editor.

Disable the shutdown confirmation with gsettings

Step 1: Open a Terminal window. You can do this by pressing Ctrl + Alt + T or by searching for "Terminal" in the Ubuntu Dash.

Step 2: You can disable the Ubuntu shutdown confirmation using a gsettings command. Open the terminal and enter the following command:

gsettings set org.gnome.SessionManager logout-prompt false
bash

This command instructs the GNOME Session Manager to disable the logout prompt, which includes the shutdown confirmation.

Step 3: To verify that the change has taken effect, you can use the gsettings command to retrieve the current setting:

gsettings get org.gnome.SessionManager logout-prompt
bash

If the output is "false," it means the shutdown confirmation is now disabled.

Step 4: With the shutdown confirmation disabled, your system will now shut down without asking for confirmation every time you initiate a shutdown. This also works for Hibernate.

Disable the shutdown confirmation with dconf Editor

Step 1: To begin, open a terminal window by pressing Ctrl + Alt + T or searching for "Terminal" in the Ubuntu Dash. If you haven't already installed the dconf Editor, you can do so with the following command:

sudo apt-get install dconf-editor
bash

Step 2: After installation, open the dconf Editor by searching for "dconf Editor" in the Ubuntu Dash or by running this command in the terminal:

dconf-editor
bash

Step 3: Navigate to the Shutdown Confirmation Setting In the dconf Editor, navigate to the following path:

org > gnome > gnome-session > logout-prompt
bash

Step 4: In the "logout-prompt" section, you'll see a switch for "logout-prompt." By default, it is enabled. To disable the shutdown confirmation, toggle the switch to the "off" position.

Image of the dconf Editor, showing the Logout prompt key.
Image of the dconf Editor, showing the Logout prompt key

While the Ubuntu shutdown confirmation is there to prevent accidental shutdowns, it can be inconvenient for some users. Disabling it using the gsettings command or the dconf Editor is a straightforward process, as demonstrated in this small guide. Remember that with great power comes great responsibility, and disabling this confirmation means you need to be more cautious when shutting down your system.

Enjoy your streamlined shutdown process!

Photo by John Smit

About Marcel Bootsman

Marcel discovered the web in 1995. Since then he has paid attention to and worked with lots of technologies and founded his own WordPress oriented business nostromo.nl in 2009.

Currently Marcel is Business Development Manager Dutch & DACH Markets at Kinsta where he helps Kinsta's client base grow with Managed WordPress, Application, Database and Static site hosting.

You can contact Marcel on a diverse range of online platforms. Please see the Connect section on the homepage for the details.