Linux: User and Group file interpretation (/etc/passwd,/etc/shadow,/etc/group,/etc/gshadow)

Source: Internet
Author: User

One, user files:/etc/passwd

[[email protected] ~]# Cat/etc/passwdroot:x:0:0:root:/root:/bin/bash 1 2 3 4 5 6 7 |  | | |     |      |   | |  | | |     |      |   |--the default shell used by the user |  | | |     |   |--User Home Directory |  | | |   |--User Finger Information (Note information) |   | | | |--user group ID (GID) |   | |--User ID (UID) | |--Password placeholder (password saved in/etc/shadow file) |--user name

Add user command: useradd [option] ... This file is the username operation.

The new user home directory defaults to/home/username, and the contents of the home directory are copied from the contents of the/etc/skel directory.

Second, the user password file:/etc/shadow

[[email protected] ~]# cat /etc/shadowroot:$1$. Tzs2yur$uq3.5xlbdehlkak9hkqzx/:16042:0:99999:7: blank: blank: Blank  1            2                             3   4    5   6  7    8   9 |            |                             |    |   |   |  |    |    |--reserved field, currently empty  |           |                             |   |    |   |  |    |--User Expiration Date (Units/day), This field specifies the number of days that the user has been invalidated (from January 1 to the date of 1970)  |           |                              |   |   |    |  |--disable this user for the number of days after the password expires  |            |                             |   |   |    |--how many days in advance warning user password will expire  |           |                              |   |   |--two times the maximum number of days to change the password interval  |            |                             |   | --Two days with minimum password change interval  |           |                              |--the last time the password was modified (Units/day), from January 01, 1970 to present days  |            |--user password (corresponding to the password placeholder in the/etc/passwd file), if the password is added "!!" Indicates that the user  |--user name is disabled (corresponding to the user name in the/etc/passwd file)   Note: Where the value of fields 4, 5, 6, 7, 8 is empty, the account can be used permanently

Set User password command: passwd [option] ... This file is the username operation.



Third, user group files:/etc/group

[Email protected] ~]# Cat/etc/grouproot:x:0:root |  | |   |--extra groups (can be multiple with "," separated) |   | |--group ID (GID) | |--Group Password placeholder |--group name

Add Group command: groupadd [option] ... GROUPNAME

Second, user group files:/etc/gshadow

[Email protected] ~]# cat/etc/gshadowroot: blank: blank: Root |    |    |    |--comma-delimited Group members |    |    |--a comma-delimited group Administrator | |--encrypted password |--group name


This article is from the "kobebryant" blog, make sure to keep this source http://beautifual.blog.51cto.com/3678509/1700834

Linux: User and Group file interpretation (/etc/passwd,/etc/shadow,/etc/group,/etc/gshadow)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.