- New User group: Groupadd
- Groupadd [-G GID] Group name
No-G is created according to the system default GID group, like the user, GID is also starting from 500
- Delete user group: Groupdel
Before deleting a user group, you need to delete the user in the group
- Added users: useradd
- Useradd [-U UID] [-G GID] [-D HOME] [-m] [-s] User name
- -U: Custom UID
- - G: Make it belong to a GID or gname that already exists(by default, the new user belongs to the same group name as the user name)
- -D: Customizing the user's home directory
- -M: Do not set up home directory
- -S: Custom shell
- Modify user information: Usermod
- Usermod [-D Home] [-G GID] [-c Comment] User name
- -G: Owning group
- -C: Comments
- -D: Home directory
- Delete User: Userdel
- Userdel [-R] Username
- - R : The function of the option is to delete the user, along with the user's home directory.
- Create modify user password: passwd
- passwd [username] ( non-superuser, cannot specify user name when using this command, not Superuser can only set or modify their own password )
- passwd does not follow the user name is to change the current user's password
- User identity switch: su
- Su [-] username
- Can be followed by "-" can also not, ordinary users su username is to switch to the root user, of course, the root user can also su to ordinary users
- Introduction to related configuration files
- /etc/group : Stores all user group information in the current system
- GROUP:X: 123:AB,CD, EF
- Group name: group Password placeholder: Group number: List of user names in the group
-
- /etc/passwd : Stores all user information in the current system
- USER:X: 123:456:xxxxxxxxx:/home/user:/bin/bash
- User name: Password placeholder: User number: User group number: User comment information: Home directory: Shell type
- /etc/shadow : Stores password information for all users in the current system
- USER:VF ..... ::::::
- User name: Password:::::
Linux Commands-user group management