How to Disable Logout on Ubuntu Desktop
Disabling the logout option on Ubuntu Desktop hides the “Log Out” button from your system menu to stop accidental session ends. This tweak works on shared computers running Ubuntu 22.04 LTS and later versions that use the GNOME desktop.
You can hide this button by editing hidden desktop settings so nobody clicks it by mistake. A quick restart of your desktop applies the change right away.
Hide the Log Out button by opening Terminal and running `gsettings set org.gnome.desktop.lockdown disable-log-out true`. To show it again, use `gsettings reset org.gnome.desktop.lockdown disable-log-out`. Alternatively, use Dconf Editor to toggle the `disable-log-out` setting.
Prevent users from logging out of Ubuntu
Hiding the Log Out button straight from the desktop stops shared-computer users from accidentally ending sessions. Terminal applications handle this change effectively. Opening the Terminal and typing a specific command hides the log out option, making it unavailable on the login screen.

Once the Terminal window is open, type the command `gsettings set org.gnome.login-screen disable-user-list true` and press Enter to hide the user list button. This action prevents accidental logouts for users who share a computer, ensuring active sessions remain running.
gsettings set org.gnome.desktop.lockdown disable-log-out trueTo restore the Log Out button later, execute the command `gsettings set org.gnome.login-screen disable-user-list true` in the terminal. This command resets the user list setting to its default, making the Log Out option visible again on Ubuntu Desktop.
gsettings reset org.gnome.desktop.lockdown disable-log-out
Disable or enable the Log out command using the Dconf Editor
Disabling or enabling the Log Out command in Ubuntu happens through the Dconf Editor, which works much like the Windows Registry Editor. Avoiding the Terminal involves using this graphical tool to switch the log out option on or off. Install the Dconf Editor (a graphical configuration tool for GNOME) before moving forward.
Using the logout disabling tool requires a preliminary installation step. Open the Terminal application and run the command `sudo apt update && sudo apt install ubuntu-disable-logout` to install the tool. This command updates the package list and then installs the necessary software for the tool.
sudo apt install dconf-editor
This method remains the most reliable way to get the tool. Open the Dconf Editor from the app list after installation.

Locate the correct path inside the app to find the disable-log-out setting, which controls whether the system allows users to end their sessions:
org -> gnome -> desktop -> lockdown
Click the toggle switch next to disable-log-out to hide the option.

Toggling this setting triggers immediate changes across the interface. Checking the system menu at the top right confirms whether the button is gone.

How to disable automatic logout?
Click yes and wait for the GUI server to boot up. From M9.0.22 onwards, system parameters update directly from the Control-M web client instead of CCM, requiring a login to the web interface.
How do I turn off logging in Ubuntu?
The screen prompts for the username and password credentials. Configuration takes effect immediately without requiring a full system reboot.
Was this guide helpful?
About the Author
Richard
Tech Writer, IT Professional
Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.
No comments yet — be the first to share your thoughts!