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 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
May be interested
- How to increase the number of Remote Desktop connectionsremote desktop also has a unique feature that is the ability to connect multiple devices in one session. so how to increase the number of remote desktop connections? invite you to read along to follow the instructions below!
- How to Update Desktop MATE 1.26 on Ubuntu 21.04ubuntu mate is a flashback version of ubuntu that allows you to continue using ubuntu almost entirely the way it worked more than a decade ago.
- 7 ways to speed up Ubuntuubuntu is the most widely used linux distribution due to its beautiful interface and power. but there are a few simple ways we can still make the operating system run faster.
- How to Install Ubuntu 13.10ubuntu is a kind of linux operating system designed to run on desktop and laptop computers. ubuntu is an open-source program, meaning its code can be accessed and modified by end users. and because it's free, ubuntu is said to be the most...
- How to install desktop/GUI environment in Ubuntu Serverif you are just installing ubuntu server for the first time, you may want a familiar user interface, similar to ubuntu desktop, for example.
- Learn about Ubuntu Remote Desktopdo you need to connect to a remote computer? instead of having to move from room to room, if the devices are on the same network, this will be easy, regardless of the operating system you use.
- 5 Reasons Ubuntu Cinnamon Is Better Than Other Ubuntu Versionsubuntu cinnamon became an official ubuntu release in 2023. it gives you ubuntu but with the cinnamon desktop environment instead of gnome.
- Ways to install Ubuntu on Windows, run in parallel or run separatelythere are many ways to install ubuntu on your computer, such as installing ubuntu from usb, cd, installing ubuntu running in parallel with windows, installing it
- Tips and tricks after installing Ubuntuubuntu is one of the completely free open source operating systems. this is a distribution (distro) of linux with the second highest amount of traffic after linux mint.
- What is Session Hijacking? Common Session Hijacking Attackssession hijacking is the act of intentionally taking control of a user's web session.