Home >System Tutorial >LINUX >How to use command to switch user login in Linux
In Linux, use the "su - [username]" command to switch users. 1. Open a terminal and type "su - [username]" (replace with the target username). 2. Enter the target user password and press Enter. 3. Complete the switch. Note: Use "su -" to switch to any user, including root, but requires entering the target user's password, not the current user's password. Use caution when using root privileges.
Switch Linux user login command
In a Linux system, you can use the command line to easily switch between different users. switch between.
Command:
<code>su - [用户名]</code>
Steps:
Enter the following command:
<code>su - [用户名]</code>
where [username] is the user you want to switch to.
For example:
To switch from the current user to a user named "bob", execute the following command:
<code>su - bob</code>
Note:
The above is the detailed content of How to use command to switch user login in Linux. For more information, please follow other related articles on the PHP Chinese website!