4 ways to log out of an Ubuntu Desktop session

This article will describe 4 ways in which users can log out of their Ubuntu 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:

4 ways to log out of an Ubuntu Desktop session Picture 14 ways to log out of an Ubuntu Desktop session Picture 1

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:

4 ways to log out of an Ubuntu Desktop session Picture 24 ways to log out of an Ubuntu Desktop session Picture 2

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:

4 ways to log out of an Ubuntu Desktop session Picture 34 ways to log out of an Ubuntu Desktop session Picture 3

Click on the Keyboard search result and you will be able to see the following view:

4 ways to log out of an Ubuntu Desktop session Picture 44 ways to log out of an Ubuntu Desktop session Picture 4

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:

4 ways to log out of an Ubuntu Desktop session Picture 54 ways to log out of an Ubuntu Desktop session Picture 5

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

4 ways to log out of an Ubuntu Desktop session Picture 64 ways to log out of an Ubuntu Desktop session Picture 6

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.

3.5 ★ | 2 Vote