Display user Information
ID User
cat/etc/passwd
1, Build Users:
Useradd username//New user
passwd username//Set a password for the user
2. Build Working Group
Groupadd groupname//new workgroup
3, new users at the same time increase the Working group
USERADD-G groupname username//new user and added to workgroup
Useradd parameter:-G belongs to group-D home Directory-s settings used by shell
4. Increase the Working Group for existing users
Usermod-g groupname username (This will remove the user from the other group)
Usermod-a groupname username (this will simply add the user to the group and will not remove the user from the other group)
Or: Gpasswd-a user Group
If you want to make a group of people can sudo to an account in the group (for public account use) under
Can be set up under/ETC/SUDOERS.D a file content as follows, it can be the ETL group of all users can be cut to ETL users without password.
%etl all= (All) NOPASSWD:/bin/su ETL
%etl all= (All) nopasswd:/bin/su-etl
5. Temporary shutdown: The second field (password) in the/etc/shadow file that belongs to the user is preceded by a *. To restore the user, remove the *.
Or, use the following command to close the user account:
passwd username–l
Or
Usermod-l username
Re-release:
passwd Username–u
Or
Usermod-u username
6. Permanently delete user account
Userdel username
Groupdel GroupName
USERDEL-RF Peter (Force the deletion of the user and all files in the user's home directory)
7. Remove users from the group
Edit/etc/group Find the line where the user name is located delete
or with a command.
gpasswd-d username GroupName
Linux Add/Remove users and user groups