+5 votes
588 views
How to log out of Linux from terminal

in Linux / Unix by (552k points)
reopened | 588 views

1 Answer

+3 votes
Best answer

1. How to log out of Linux Mint
2. How to log out of Ubuntu
3. Use the exit command to log out of Linux
4. Use the kill command to log out of Linux

The constant use of computer equipment has increased over time thanks to the thousands and thousands of tools available for both work and entertainment issues . However, it is not good to be countless hours in front of the computer screen without taking a break. That is why it is important to log out during this period if we do not want to turn off the device completely..

If you are a Linux user, any of your current distributions, we usually log out from the user menu:

image

But did you know that the Linux distros terminal goes far beyond executing extremely complex commands and from there we can close our session in a practical way? If you didn't know this today TechnoWikis will explain how to achieve it.


1. How to log out of Linux Mint

Step 1

Linux Mint is a Debian-based distribution with which we have a modern and dynamic environment, to log out there we will access the terminal and execute the following:
 cinnamon-session-quit 
Pressing Enter will display a small pop-up window where we can select:
  • Log out
  • Change user.
  • Cancel the operation.
image
Step 2

There we click on Log Out to close the current Linux Mint session and we will be on the login screen to re-enter the credentials:

image


2. How to log out of Ubuntu


Ubuntu is the most popular distribution of Linux for all its features and updates it has launched, therefore we have a basic command to log out and protect access to the system.
Step 1

To achieve this, we access the terminal and there we execute the following:
 gnome-session-quit 
In doing so, the following pop-up window will be displayed, which has a 60-second counter to log out automatically or we can do it manually:

image

Step 2

In doing so, we will be returning to the well-known Ubuntu login screen:

image


3. Use the exit command to log out of Linux


There are some commands that execute the closing session without giving us the possibility to cancel the operation.
Step 1

Exit (exit), is a command that when executing and pressing Enter automatically closes the session, for example in Ubuntu we execute it:

image

Step 2

Upon entering Enter, we immediately go to the login to select the user: image
Step 3

In the case of CentOS it happens the same we execute the exit command: image
Step 4

Press Enter and automatically we must login: image

4. Use the kill command to log out of Linux

Step 1

Another of the commands that does not allow us to cancel the operation is the kill command, for this, we must first know the name (if we do not know) of the user who has logged in, for this we execute:
 sudo who 
We see that the user is solvetic, now we will execute the following:
 sudo pkill -KILL -u solvetic 
image
Step 2

When giving Enter we will be at the beginning of the session: image
Step 3

This same method works for Debian and Ubuntu:

image

Step 4

We give Enter and we must select username and password:

image

We see the different options available to log out of Linux in a different but fully functional and secure way, always keeping in mind the key that is the security of our information and the operating system itself..


by (3.5m points)
edited

Related questions

+3 votes
1 answer
asked Nov 19, 2021 in Guides by backtothefuture (552k points) | 106 views
+3 votes
1 answer
+5 votes
2 answers
asked Aug 23, 2019 in Linux / Unix by backtothefuture (552k points) | 532 views
+3 votes
1 answer
asked May 9, 2023 in Internet by backtothefuture (552k points) | 76 views
+4 votes
1 answer
asked May 26, 2021 in Internet by backtothefuture (552k points) | 388 views
Sponsored articles cost $40 per post. You can contact us via Feedback

Most popular questions within the last 30 days

10,659 questions
10,791 answers
510 comments
3 users