In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
Blog structure user ID: UID and GID user account: / etc/passwd file structure / etc/shadow file structure about group: / etc/group file structure add and remove user functions add and remove group account management case
Id: id plus users will display UID and GID
User identification code
Each logged-in user will get at least two ID
One is the user ID: (User ID, UID for short)
One is the group ID: (Group ID, GID for short)
User account number
If users on Linux systems need to log in to the Linux operating system to get the corresponding Shell environment to work, they need to go through the following steps:
First of all, find out whether the corresponding account information exists in the / etc/passwd file, and if not, pop out; if so, read the UID and GID corresponding to the account in / etc/passwd and / etc/group, in addition, the host directory and Shell environment of the account will also be read out; second, check whether the password is correct. At this time, the Linux system will enter the / etc/shadow file to find the corresponding account and UID, and check whether the entered password is correct; finally: if there is no problem with the above conditions, this will log in to the Linux system normally
/ etc/passwd file structure (divided into 7 paragraphs)
The structure of the / etc/passwd file is: each line represents an account, and several lines indicate that there are several accounts in the system, many of which are needed for the normal operation of the system, and we make them the users of the system program. Note that these accounts cannot be deleted or modified at will.
1. Account name: account number 2. Password 3. UID: this is the user identification code 4. GID5. User information description column 6. Home folder 7. The Shell environment in which the user logs in to the system
/ etc/shadow file structure (divided into 9 paragraphs)
The / etc/shadow file structure is also one line corresponding to one user information, but this file is mainly used to store user password information, and the contents of this file are not allowed to be modified or deleted at will.
1. Account name 2. Password 3. The date the password was last changed is 4.. The number of days that the password cannot be changed. The number of days the password needs to be changed is 6. The number of warning days before the password change period is 7. The account grace time (expiration period) after the expiration of the password is 8. Account expiration date 9. Keep
Effective group and initial group
The / etc/group file, where each line represents a group, is also separated by ":", with the meaning of each paragraph: the first paragraph: the group name; corresponding to the GID of the third field; the second paragraph: the group password; also a password placeholder, usually set by the system administrator; the third paragraph: GID; is the fourth paragraph of GID; corresponding to the fourth field of / etc/passwd: the account name supported by this group That is, which users join this group?
The UID of root is 0, and GID is also 0. If you go to / etc/group, you can know that the group name when GID is 0 is root. As for the search for the password, you will find the line with the same account name in / etc/shadow and / etc/passwd, which is the password-related data.
/ etc/gshadow file structure
First paragraph: group name
The second paragraph: password column, beginning with "!" Indicates that there is no legal password, so there is no group administrator
The third paragraph: the account of the group administrator
Paragraph 4: join the account supported by the group
Account management instruction
(1) useradd command
Add the user's instruction with the following parameters:
Use the "useradd-D" command to view the default values set by the system, as shown in the figure:
(2) passwd command
Used to set the password
(3) usermod command
The usermod command is mainly used to set the parameters of the account.
(4) userdel command
Delete the user's instruction
(5) groupadd command
The groupadd command is used to add new user groups
-g: followed by a specified GID
-r: create a system group
(6) groupmod command
Used to modify the group name, permissions.
-g: modify the existing GID number
-n: modify the existing group name
(7) groupdel command
Delete group instruction
(8) gpasswd command
If there are no parameters Give groupname a password (/ etc/gshadow)-A: leave the control of groupname to the following users (the administrator of the group)-M: add certain accounts to this group-r: remove the password of groupname-R: invalidate the password field of groupname-a: add a user to the group groupname-d: remove a user from the group groupname
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
#! / bin/bashecho "# # MySQL installing.####" ec
© 2024 shulou.com SLNews company. All rights reserved.