---
name: "passwd"
section: "5"
platform: "linux"
package: "shadow"
version: "4.20.0.arch1-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux", "freebsd", "openbsd", "macos"]
url: "https://new.carta.tech/passwd/5"
---

# passwd(5)

the password file

## NAME

passwd - the password file

## DESCRIPTION

/etc/passwd contains one line for each user account, with seven fields delimited by colons (“:”). These fields are:

• login name

• optional encrypted password

• numerical user ID

• numerical group ID

• user name or comment field

• user home directory

• optional user command interpreter

If the *password* field is a lower-case “x”, then the encrypted password is actually stored in the [**shadow**(5)](/shadow/5.md) 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)](/crypt/3.md) for details on how this string is interpreted.

If the password field contains some string that is not a valid result of [**crypt**(3)](/crypt/3.md), 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)](/finger/1.md). 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.

## FILES

/etc/passwd

User account information.

/etc/shadow

Optional encrypted password file.

/etc/passwd-

Backup file for /etc/passwd.

Note that this file is used by the tools of the shadow toolsuite, but not by all user and password management tools.

## CAVEATS

Unprivileged users may write arbitrary non-ASCII characters in the GECOS field, notably including C1 control characters. When reading this file, use the C locale. Otherwise, the contents may look different than they are.

## SEE ALSO

[**crypt**(3)](/crypt/3.md), [**getent**(1)](/getent/1.md), [**getpwnam**(3)](/getpwnam/3.md), [**login**(1)](/login/1.md), [**passwd**(1)](/passwd/1.md), [**pwck**(8)](/pwck/8.md), [**pwconv**(8)](/pwconv/8.md), [**pwunconv**(8)](/pwunconv/8.md), [**shadow**(5)](/shadow/5.md), [**su**(1)](/su/1.md), [**sulogin**(8)](/sulogin/8.md).
