2, user, user group management operation detailed:
2.1 AddUser Add Users:
AddUser [-u uid][-g group][-d home][-s Shell]
- u: give directly the UserID
- G: give directly the GID
- D: directly establish the root directory in an existing directory
- S: definition Shell
Add User Garfield
Verify that the user Garfield was successfully added through the three user management files described earlier:
When we create new users, the basic settings for new users are implemented through the/etc/login.defs and/etc/default/useradd two files.
Cat/etc/login.defs
Cat/etc/default/useradd
in this file Skel This option specifies that the user's root directory content is copied from the/etc/skel directory in the past.
2.2 passwd Set User password:
passwd [user name] setting password
2.3 usermod Disable, Enable account:
usermod-l [user name ] Disable account
usermod-u [user name ] Enable account
usermod-e yyyy-mm-dd [user name ]
Usermod
command to disable and enable accounts through the
/etc/shadow
the corresponding
user password bit before adding and deleting "!" to implement.
2.4 Groupadd Create Group:
Groupadd [-G gid [-o]] [-R] [-F] Group
2.4.1 when creating a user, specify that the user belongs to that user group :
Usersadd-g group_name user_name
2.4.2 to change a user's user group:
Usermod–g group_name user_name
2.4.3 adding users to other groups:
Usermod–g group_name user_name
2.5 Modify the name of the group:
Groupmod-n new_group_name old_ group_name
2.6 Modify User name:
Usermod–l New_user_name old_ user_name
2.7 Deleting a User:
Userdel [-R] User_name
2.8 To Delete a group:
Groupdel group_name
Linux User, user group Rights Management detailed---02