Home> System Tutorial> LINUX> body text

How to use command to switch username in linux

下次还敢
Release: 2024-04-11 17:48:15
Original
736 people have browsed it

In Linux, use the su command to switch user names: 1. Enter su, 2. Enter the target user name, 3. Enter the target user password.

How to use command to switch username in linux

How to use commands to switch user names in Linux

In Linux systems, switching user names is a common operate. You can do this using the following steps:

Step 1: Type thesucommand

Type the following command to startsuCommand:

su
Copy after login

Step 2: Enter the username you want to switch to

You will be prompted to enter the username you want to switch to. Enter your username and press Enter:

user_name
Copy after login

Step 3: Enter your password

You will be prompted to enter the password for the user you want to switch to. Enter the password and press Enter:

password
Copy after login

If you enter the correct password, you will successfully switch to the specified user's shell. You can see the username of the switched user in the command prompt.

For example, if you switch fromuserAtouserB, your command prompt will change from:

[userA@hostname]$
Copy after login

to:

[userB@hostname]$
Copy after login

The above is the detailed content of How to use command to switch username in linux. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!