How to Change Between Users on Linux

Linux is a powerful operating system that is known for its stability, security, and customization options. One of the most important features of Linux is its multi-user support, which enables multiple users to log in and work on the same machine simultaneously.
The ability to switch between users is an important feature of Linux that allows you to share a machine with others and maintain your privacy and security. In this article, we will discuss how to change between users on Linux.
- Using the command line:
The easiest way to switch between users is to use the command line. Open up a terminal window and type the following command:
su –
This will prompt you for the password of the user you wish to switch to, and once you enter it correctly, you will be logged in as that user. You can then execute commands and perform tasks as if you were the other user.
- Using the switch user (su) command:
Another way to switch between users is to use the su command. This command allows you to switch to any user on the system, provided that you have the password for that user.
To use the su command, open up a terminal window and type the following command:
su username
Replace ‘username’ with the name of the user you wish to switch to. After you enter this command, you will be prompted for the password of that user. Once you enter it correctly, you will be logged in as that user and can execute commands and perform tasks as if you were the other user.
- Using the desktop interface:
If you are using a graphical desktop interface such as GNOME or KDE, you can switch between users by clicking on the user icon in the system tray. This will bring up a list of users who are currently logged in. Simply select the user you wish to switch to, and you will be prompted for their password. Once you enter it correctly, you will be logged in as that user.