Skip to content
Follow
Ubuntu Linux

How to Disable Logout on Ubuntu Desktop

Richard
Written by
Richard
Jan 31, 2023 Updated Sep 15, 2026 2 min read
How to Install Google Chrome on Ubuntu Linux
How to Install Google Chrome on Ubuntu Linux

Disabling the log out button on Ubuntu Desktop removes the “Log Out” option from your system menu to stop accidental session ends. This tweak helps on shared computers running Ubuntu 22.04 LTS and later versions that use the GNOME desktop environment.

Advertisement

You can hide this button by changing a hidden desktop setting in your system files. Restart your desktop after making the change to apply it right away.

⚡ Quick Answer

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.

Advertisement

Prevent users from logging out of Ubuntu

You can disable logout Ubuntu by running a quick command in the Terminal to hide the log out button from your screen. This stops other people who use your computer from accidentally ending your active session or shutting down the desktop environment.

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

Open the Terminal and run this command: `gsettings set org.gnome.login-screen disable-user-list true` This action prevents accidental logouts for users who share a computer, ensuring active sessions remain running.

⚠️Warninggsettings set org.gnome.desktop.lockdown disable-log-out true

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

To 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.

Advertisement

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

Disable or enable the Log out command using the Dconf Editor

You can disable or enable the log out command without using the command line by using the Dconf Editor (a graphical configuration tool for GNOME). This app lets you toggle system settings on and off using a visual menu instead of running text commands.

⚠️WarningSecurity Disclaimer: Please note that this is only a UI-level restriction.

Security Disclaimer: Please note that this is only a UI-level restriction. It is not a robust system-level security measure and will not stop someone who knows how to use the command line.

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.

Advertisement

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.

ubuntu linux decon editor install
Ubuntu Linux dconf editor install

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

Advertisement

Click the toggle switch next to disable-log-out to hide the option.

Ubuntu Linux disable log out command
Ubuntu Linux disables the logout of the command.

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

Ubuntu Linux with log out enabled
Ubuntu Linux without enabled

How to disable automatic logout?

Click yes and wait for the GUI server to boot up.

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?

Was this helpful?
Richard

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.

Advertisement

📚 Related Tutorials

How to Install OpenLiteSpeed on Ubuntu Linux
Ubuntu Linux How to Install OpenLiteSpeed on Ubuntu Linux
How to Install Apache on Ubuntu Linux
Ubuntu Linux How to Install Apache on Ubuntu Linux
How to Install Ghost on Ubuntu Linux with Nginx
CMS How to Install Ghost on Ubuntu Linux with Nginx
How to Install WildFly on Ubuntu Linux
Ubuntu Linux How to Install WildFly on Ubuntu Linux

No comments yet — be the first to share your thoughts!

Leave a Comment

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