Linux users and user groups, linux User Groups
Users and user groups
1./etc/group
Group Name: x: group number: User List
Group No. 1-499 Reserved System No.
Group No. 500-User Creation
2./etc/gshadow
Group Name: group password: Group Administrator: User List
3./etc/passwd
Username: Password placeholder: user No.: User Group No.: Comment: main directory: shell Type
4./etc/shadow
Username: Password :::::
5. Group
Groupadd group name
-G group ID # specify group ID
Groupmod-n new group name original group name
-G group no. Original group name # modify group no.
Groupdel group name
6. User
Useradd-g group name Username
-G: Specifies the group name.
-D specifies the home Directory of the user.
# If no group is specified, a group with the same user ID will be created.
Usermod-c comment User Name
-L new username original username # modify Username
-D directory # modify the home Directory
-G # modify the group
Userdel-r user name
-R # Delete All User Files
Touch/etc/nologin # temporarily prohibit non-root Account Login
7. Other commands
Passwd-l User Name
-L lock user
-U unlock
-D logon without a password
Gpasswd-a username group name ,...
-D remove the affiliated group
# Add a user to a group (affiliated group)
Newgrp affiliated group # Switch to the affiliated group (requires the group password)
Useradd-g main group-G affiliated group 1,... Username
Su username # Switch user
Id Username
Groups User Name
Chfn username # Set User details
Finger username # Show user details
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.