Linux users and user group management

User Management:

1. Add user:
common syntax; useradd user name
Common options:
-g: indicates the specified user group
-G: indicates the specified user's additional group
-u: uid, user id, uniquely identifies a user
2. Modify user:
Common syntax: usermod option username
-g: indicates the specified user group
-G: indicates the specified user's additional group
-u: uid, user id, uniquely identifies a user
-l new user name original user name: modify user name
3. Set password
passwd user name;
switch user: su user name
4. Delete user
Common syntax: userdel user name
Common options:
-r: delete the home directory while deleting

User group management:

Add user group:
common method: groupadd group name

User group modification:
common commands: groupmod -g 520 (new group id) -n new group name will be modified group name

Deletion of user group: groupdel group name (note that if there are users in the group, the group member must be deleted first)

Published 23 original articles · Like 11 · Visits 30,000+

Guess you like

Origin blog.csdn.net/weixin_42279584/article/details/90550664