1. view all users in Linux
In linux, there are no convenient commands like windows's net user and net localgroup to manage the user. Xwindows interface.
(1) In the terminal, you only need to view the/etc/passwd file.
(2) Check the third parameter: more than 500, which is the user created later. Others are system users.
Or use cat/etc/passwd | cut-f 1-d:
2. User management commands
Useradd Note: Add a user
Adduser Note: Add a user
Passwd Note: set a password for the user
Usermod Note: to modify user commands, you can use usermod to modify the logon name and user's home directory;
Pwcov Note: Synchronize users from/etc/passwd to/etc/shadow
Pwck Note: pwck verifies whether the content of the user configuration file/etc/passwd and/etc/shadow is legal or complete;
Pwunconv Note: it is the vertical reverse operation of pwcov. It is to create/etc/passwd from/etc/shadow and/etc/passwd, and then delete the/etc/shadow file;
Finger Note: Tools for viewing user information
Id Note: view the UID, GID, and user group of the user.
Chfn Note: Change User information tool
Su Note: User Switching Tool
Sudo Note: sudo uses another user to execute commands (execute a command as another user), su is used to switch users, and then the user to complete the corresponding tasks through the switch, however, sudo can directly execute the following commands. For example, sudo can execute root authorization without the root password. Only root can execute the corresponding commands; however, you must edit/etc/sudoers through mongodo;
Except do note: visodo is the command for editing/etc/sudoers. You can also use vi to edit/etc/sudoers;
Sudoedit Note: similar to the sudo function;
3. Tools or commands used to manage user groups;
Groupadd Note: Add a user group;
Groupdel Note: delete a user group;
Groupmod Note: Modify user group information
Groups Note: displays the user group to which the user belongs.
Grpck
Note: Use the/etc/group and/etc/gshadow file content to synchronize or create/etc/gshadow. If/etc/gshadow does not exist, create it;
Grpunconv Note: Use the/etc/group and/etc/gshadow file content to synchronize or create/etc/group, and then delete the gshadow File