passwd - 密 码 文 件
/etc/passwd contains one line for each user account, with seven fields delimited by colons (“:”). These fields are:
• 登 录 名
• 可 选 的 加 密 后 的 密 码
• 数 字 用 户 ID
• 数 字 组 ID
• 用 户 名 和 注 释 字 段
• 用 户 主 目 录
• 可 选 的 用 户 命 令 解 释 器
If the password field is a lower-case “x”, then the encrypted password is actually stored in the shadow(5) file instead; there must be a corresponding line in the /etc/shadow file, or else the user account is invalid.
The encrypted password field may be empty, in which case no password is required to authenticate as the specified login name. However, some applications which read the /etc/passwd file may decide not to permit any access at all if the password field is blank.
A password field which starts with an exclamation mark means that the password is locked. The remaining characters on the line represent the password field before the password was locked.
Refer to crypt(3) for details on how this string is interpreted.
If the password field contains some string that is not a valid result of crypt(3), for instance ! or *, the user will not be able to use a unix password to log in (but the user may log in the system by other means).
The comment field, also known as the gecos field, is used by various system utilities, such as finger(1). The use of an ampersand here will be replaced by the capitalised login name when the field is used or displayed by such system utilities.
The home directory field provides the name of the initial working directory. The login program uses this information to set the value of the $HOME environmental variable.
The command interpreter field provides the name of the user's command language interpreter, or the name of the initial program to execute. The login program uses this information to set the value of the $SHELL environmental variable. If this field is empty, it defaults to the value /bin/sh.
/etc/passwd 用 户 账 户 信 息 。
/etc/shadow 可 选 的 加 密 后 的 密 码 文 件
/etc/passwd 的 备 份 文 件 。 注 意 ， 此 文 件 由 shadow 工 具 集 使 用 ， 而 不 是 所 有 的 用 户 和 密 码 管 理 工 具 都 会 使 用 。