How to change username in linux

青灯夜游
青灯夜游Original
2021-04-22 17:43:2480244browse

How to modify the username in Linux: 1. Enter the terminal, execute the "su -" command, enter the password, and obtain root permissions; 2. Execute "usermod -l new username old username" or "groupmod - n New Username Old Username" command to modify the username; 3. Restart the computer.

How to change username in linux

The operating environment of this tutorial: Red Hat Enterprise Linux 6.1 system, Dell G3 computer.

How to change the user name in Linux

(Assume that the old user name is test and you want to change it to the new user name love)

1. Enter the terminal, enter: su - Enter, then enter the password to obtain root permissions. As shown below:

Enter: usermod -l love -d /home/love -m test and press Enter . As shown below:

or enter: groupmod -n love test and press Enter . As shown below:

#3. Restart the computer and the user name has been modified.

Related recommendations: "Linux Video Tutorial"

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

Statement:
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