Explanation of the contents of the/etc/shadow,/etc/passwd,/etc/shadow,/etc/passwd file

Source: Internet
Author: User

1.1/ETC/PASSWD File Content Format

This directory stores the operating system user information, which is visible to all users

User name: Password: uid:gid: User description: Home directory: Login Shell

As an example:

    

You can see that the/etc/passwd file is the user's information, consisting of 6 semi-colons of 7 information, explained as follows

User name: identity string for each user

Password: The x here indicates a dark text display. If it is any other number, it represents the password plaintext.

UID: Each user must be assigned a userid, "0" for root reserved id.1-99 for system reservation, assigned to the system pre-defined account. Linux users can be divided into 3 categories: Superuser (root User ID is 0), administrative users, and regular users.

There is a class of users in the system called Pseudo-users (Psuedo users) who also occupy a record in the/etc/passwd file, but cannot log on because their logon shell is empty.
Their existence is mainly to facilitate the system management, to meet the corresponding system process of the document owner requirements.

Common pseudo-users in/etc/passwd files

Pseudo user Meaning
Bin Have an executable user command file
Sys Owning system files
Adm Owning an account file
Uucp UUCP use
Lp LP or LPD subsystem use
Nobody NFS Use
In addition to the pseudo-users listed above, there are a number of standard pseudo-users, such as: Audit, cron, mail, Usenet, etc., and they are all needed for related processes and files. GID:Field records the user group to which the user belongs. It corresponds to a record in the/etc/group file.

  

User Description: the field records some of the user's personal circumstances, such as the user's real name, phone, address, etc., this field does not have any practical use.

Home directory: The user's starting working directory, which is the directory where the user logs on to the system. In most systems, each user's home directory is organized under the same specific directory, and the user's home directory name is the user's login name. Each user has read, write, execute (search) permissions on his or her home directory, and other users ' access to this directory is set according to the specific circumstances.

Login Shell: After the user logs in, to start a process, responsible for the user's actions to the kernel, the process is the user log on to the system after the command interpreter or a specific program, the shell. The shell is the interface between the user and the Linux system. There are many types of Linux shells, each of which has different characteristics. Commonly used are sh (bourneshell), CSH (Cshell), Ksh (KornShell), tcsh (Tenex/tops-20typecshell), Bash (Bourneagainshell), etc. System administrators can assign a shell to a user based on system conditions and user habits. If you do not specify a shell, then the system uses SH as the default login shell, that is, the value of this field is/bin/sh.

If the shell here is:/sbin/nologin, it means that the user cannot log on. The advantage of this is that FTP users can only log on to the FTP server via FTP and cannot log in to the shell.

1.2

2./etc/shadow File Content format

The record line in the/etc/shadow file in Linux corresponds to one by one in/etc/passwd, which is automatically generated by the PWCONV command based on the data in the/etc/passwd. Its file format is similar to/etc/passwd, consists of several fields, separated by ":" Between the fields, each line of the file is 8 colons divided by 9 fields, in the following format:

Username:passwd:lastchg:min:max:warn:inactive:expire:flag

Login: Encrypted password: Last modified: Minimum time interval: Maximum time interval: Warning Time: Inactivity time: Expiry time: Flag


1 2 3 4 5 6 7 8 9 “登录名”是与/etc/passwd文件中的登录名相一致的用户账号“口令”字段存放的是加密后的用户口令字,长度为13个字符。如果为空,则对应用户没有口令,登录时不需要口令;如果含有不属于集合{./0-9A-Za-z}中的字符,则对应的用户不能登录。“最后一次修改时间”表示的是从某个时刻起,到用户最后一次修改口令时的天数。时间起点对不同的系统可能不一样。例如在SCOLinux中,这个时间起点是197011日。“最小时间间隔”指的是两次修改口令之间所需的最小天数。“最大时间间隔”指的是口令保持有效的最大天数。“警告时间”字段表示的是从系统开始警告用户到用户密码正式失效之间的天数。“不活动时间”表示的是用户没有登录活动但账号仍能保持有效的最大天数。“失效时间”字段给出的是一个绝对的天数,如果使用了这个字段,那么就给出相应账号的生存期。期满后,该账号就不再是一个合法的账号,也就不能再用来登录了。"reserved Entries", currently useless

Content format of the 1.3/etc/passwd file

/etc/group stores information about local user groups, and grouping users is a means of managing and controlling access to users in a Linux system. Each user belongs to a group of users, a group can have multiple users, and a user can belong to a different group. When a user is a member of more than one group at the same time, the primary group that the user belongs to is recorded in the/etc/passwd file, which is the default group to which the login belongs, and the other groups are called additional groups.

When a user accesses a file that belongs to an additional group, you must first use the NEWGRP command to make yourself a member of the group you want to access. All the information for the user group is stored in the/etc/group file.

1) GroupName GID to the name of a mapping, group name
2) password where to save the password
3) GID Group ID
4) User group member

Explanation of the contents of the/etc/shadow,/etc/passwd,/etc/shadow,/etc/passwd file

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.