Home >System Tutorial >LINUX >What is the command to switch username in Linux?
The command to switch usernames in Linux is usermod [option]
. The available options are: -c to set descriptive comments -d to set home directory -e to set Expiration time -L Lock account -U Unlock account -m Move home directory -s Set up login shell -G Add group membership
Switch Linux Username command
To switch the username in the Linux system, you can use the usermod command.
Syntax:
<code>usermod [选项] <新用户名> <用户名></code>
Options:
Example:
To change the username of user john to jack, you can run the following command :
<code>sudo usermod -l jack john</code>
To add membership to group sales to user mary, run the following command:
<code>sudo usermod -aG sales mary</code>
The above is the detailed content of What is the command to switch username in Linux?. For more information, please follow other related articles on the PHP Chinese website!