How to Enable or Disable Log out on Ubuntu Linux

This article describes the steps one can take to enable or disable logging out of the Ubuntu desktop.

There are many ways one can log out of the Ubuntu desktop. Users can log out using the command terminal, the desktop system menu, and possibly other commands.

For most users using Ubuntu desktop, the way to log out of one’s session is to use the system menu on the top bar. To do that, click on the System menu, select the Power button, and click the logout command.

If you want to prevent users from logging out of their session using the system menu, the steps below show you how to do that.

Prevent users from logging out of Ubuntu

As described above, you can prevent users from logging out of the Ubuntu desktop by disabling the Log out command on the system menu.

Here’s how to do that.

First, open the Terminal app in Ubuntu Linux.

You can do that by pressing the Super key (or Windows key) to show the Overview screen. Then use the search box to search for ‘Terminal‘.

Select the Terminal app to launch.

Ubuntu Linux activities overview Terminal search
Ubuntu Linux activities overview Terminal search

Alternatively, press the keyboard shortcut (CTRL + ALT + T) on your keyboard to launch the Terminal app.

When the Terminal app opens, type the commands below to disable to log-out button on the system menu.

gsettings set org.gnome.desktop.lockdown disable-log-out true

To reverse and enable to log-out command on the system menu, run the commands below.

gsettings reset org.gnome.desktop.lockdown disable-log-out

Disable or enable the log out command using the Dconf Editor

You can also use Dconf Editor to make common system changes if you can’t use the command Terminal app.

If you are familiar with Windows, then you know about Windows Registry Editor.

Ubuntu Linux doesn’t have a registry database to configure hidden system settings. Howerver, Ubuntu Linux uses the Dconf Editor tool to change low-level system configurations and settings.

You can call it a Ubuntu Linux Registry Editor because it provides similar functionality, but without a massive database that is in the Windows system.

To use Dconf Editor, you must first install it since it doesn’t come with Ubuntu Linux.

Read the post below to learn how to install software on Ubuntu Linux.

How to add or remove software on Ubuntu Linux

In the Ubuntu Software app, search for Dconf Editor to install.

ubuntu linux decon editor install
ubuntu Linux dconf editor install

After installing and launching the Dconf Editor app, navigate to the path below:

org -> gnome -> desktop -> lockdown

On the disable-log-out Dconf settings on the list, toggle the button to the On position to enable.

To disable it, simply toggle the button back to the Off position.

Ubuntu Linux disable log out command
Ubuntu Linux disables log out command

Once enabled, you should not see the log-out command on the system menu. If disabled, you should see the log out command on the system menu.

That should do it!


This post showed you how to show or hide the log out command on the system menu on Ubuntu Linux. If you find any error above or have something to add, please use the comment form below.