Linux Command User Maintenance
Basic
Add a XXX User:
useradd xxx
Add a XXX user, specify home directory for/home/xxx:
useradd -m -d /home/xxx xxx
Add a XXX user, specify the home directory as/home/xxx, and specify with bash:
useradd -m -d /home/xxx -s /bin/bash xxx
Add a XXX user, specify home directory for/home/xxx, and specify with bash, join YYY and ZZZ Group (the default XXX group is also reserved Teng Yun technology ty300.com):
useradd -m -d /home/xxx -s /bin/bash -G yyy,zzz xxx
The creation of group
groupadd xxx
To view groups with XXX user participation:
id xxx
Add the XXX user to the YYY group and the ZZZ Group:
usermod -G yyy,zzz xxx
Change the default shell of the XXX user to bash:
usermod -s /bin/dash xxx
Delete XXX Users:
userdel xxx
Delete the xxx user, along with the home directory Delete:
userdel -r xxx
The above command requires root privileges in addition to the ID XXX.
Commands to modify a user's password
passwd
Manuscripts: Diligent Learning qkxue.net
Read the full version of the Linux command user maintenance
Linux Command User Maintenance