4 ways to log out of an Ubuntu Desktop session
If you are using an Ubuntu system with multiple users and one of the other users wants to use the system, there are two options. One is to switch users and the other option is to log out of your user session for the other person to use. The difference between these two options is that when you switch users, your current session continues to run in the background and you can restore your applications to the same state when you log in again. However, when you log out, your current session will be terminated and all running applications will be stopped. So when you log back in, you'll have to reopen all the apps you need. You can choose between switching users and logging out, whichever option is right for you at the time.
This article will describe 4 ways in which users can log out of their Ubuntu session. The commands and processes mentioned in this article run on an Ubuntu 20.04 LTS system.
Method 1: Log out using the user interface
One of the simple ways to log out of an Ubuntu session is to use the menu accessible via the down arrow in the upper right corner of the Ubuntu screen. Here's the menu you'll see when you click this arrow:
Click on your username and you will be able to see the following two sub-menu items: Log Out and Account Settings. Click the Log Out option to log out of the current Ubuntu session. The following dialog box will display if you do so:
This dialog box allows you to log out immediately by clicking the Log Out button . Otherwise, the system will automatically end the session after 60 seconds unless you press the Cancel button .
Method 2: Log out using keyboard shortcuts
Ubuntu comes with a set of default keyboard shortcuts that allow you to perform commonly used Ubuntu operations using keyboard shortcuts. Logging out, a very common operation, is also assigned such a keyboard shortcut. When you press Ctrl+Alt+Del , the logout dialog box described above displays.
You can see these shortcuts and even create your own using the System Preferences utility. Open the Preferences widget directly from the Keyboard view by entering "keyboard shortcuts" in the app launcher search bar as follows:
Click on the Keyboard search result and you will be able to see the following view:
Method 3: Log out using the app launcher search bar
Another quick method to log out of a session is to use the useful app launcher search bar. You can access this bar by pressing the Super/Windows key on your keyboard.
Enter the keyword "logout" in this search bar and you will see the Log Out utility in the search results as follows:
Click on the Log Out search result and you will see the Log Out dialog box as described above.
Method 4: Sign out using Terminal
For the Terminal savvy, the Ubuntu command line also provides a way to log out of your Ubuntu user session.
Open Ubuntu command line, Terminal, via app launcher search or shortcut Ctrl+Alt+T .
Then enter the following command to end the current user's login session:
$ gnome-session-quit
When you run this command, a dialog box opens allowing you to log out by clicking the Log Out button . Otherwise, the system will automatically end the session after 60 seconds unless you press the Cancel button on this dialog box.
If you want to log out directly without seeing this dialog box, you can use the following command:
$ gnome-session-quit --no-prompt
Here are some ways to securely log out of an Ubuntu user session so that other users can use the system after you.
You should read it
- What's New in Ubuntu 21.10?
- Why is Ubuntu LTS preferred over regular distros?
- What's new in Ubuntu 18.04 LTS just released?
- How to prolong the life of Ubuntu 18.04 installation with Ubuntu Pro
- What is the difference between Ubuntu Desktop and Ubuntu Server?
- Ubuntu 21.04 users need to update the system ASAP
- 5 things to do after upgrading to Ubuntu 22.04 LTS
- 5 Reasons Ubuntu Cinnamon Is Better Than Other Ubuntu Versions
- 7 reasons to upgrade to Ubuntu 23.04
- Ubuntu 19.10: Roadmap for release & planned features
- Tips and tricks after installing Ubuntu
- What is Ubuntu? Why should you use Ubuntu to replace Windows?
Maybe you are interested
Microsoft reveals how Windows 10 and Windows 11 block keyloggers
5 Reasons People Prefer Password Login Over Email
A technological problem that makes Bill Gates helpless, having to rely on posterity
Bluetooth 6.0 brings new technology that helps Apple improve Find My network
How to change Windows 10 login wallpaper, change computer wallpaper
Cerebras Launches World's Fastest AI Inference Technology, 20x Performance Than NVIDIA