How to Disable Logout on Ubuntu Desktop

The article outlines steps to enable or disable the logout functionality on the Ubuntu desktop. Users can typically log out via the system menu on the top bar. However, to restrict this, users can disable the log out command through the Terminal app or the Dconf Editor tool. This manipulation is reversible and can be…

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

There are many ways one can log out of the Ubuntu desktop. For example, 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 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.

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.

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 the logout button on the system menu.

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

Run the commands below to reverse and enable the logout command on the system menu.

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 typical system changes if you can’t use the command Terminal app.

If you are familiar with Windows, 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 without a massive Windows system database.

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.

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, toggle the button back to the Off position.

Once enabled, you should not see the logout command on the system menu. If disabled, you should see the logout command on the system menu.

That should do it!

Conclusion:

  • Enabling or disabling the Logout command on the Ubuntu desktop system menu can be achieved through the Terminal or Dconf Editor.
  • Using the Terminal, the command “gsettings set org.gnome.desktop.lockdown disable-log-out true” disables the Logout button. To re-enable it, “gsettings reset org.gnome.desktop.lockdown disable-log-out” should be used.
  • Alternatively, the Dconf Editor can be utilized to toggle the “disable-log-out” setting under “org -> gnome -> desktop -> lockdown” to enable or disable the Logout command. After making these changes, the system menu will reflect the updated status of the Logout command.
  • This flexibility allows users to customize the Ubuntu desktop environment based on specific preferences and requirements.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *