- View information for all groups: (Information is saved in the/etc/group file)
Each of these pieces of information is divided by: the meaning of each paragraph is as follows:
User name Group name: password: User group ID: User group contains users (multiple users, split)
- View all user information: (Information saved in the/etc/passwd file)
Each of these pieces of information is divided by: the meaning of each paragraph is as follows:
User name: password: User id: ID of the user group: note Information: User directory: directory where the command is located
- View a user's information
- Command: CAT/ETC/PASSWD | grep User Name
- View a user group information
- Command: Cat/etc/group |grep Group name
- View group member information for the currently logged in user
- View user groups and members within a group
- View the currently logged in user name
- Add Users
- Command: Useradd user name
- Example: Useradd Sky
- Add users to the home directory at the same time
- Command: USERADD-M user name
- Example: Useradd-m Sky
- Delete User
- Command: Userdel user name
- Example: Userdel Sky
- Delete user and delete user name directory under home directory
- Command: Userdel-r user name
- For example: Userdel-r Sky #系统将自动删除/home/sky This user directory, regardless of whether the directory is empty
- Setting and modifying user passwords
- Command: passwd user name
- Example: passwd Sky #这样系统要求输入两次密码
Linux user groups and user management