Passwd

This article describes the format of the traditional Unix  file, and related files, including ,  , and. These files contain information about user accounts. They use text-based formats with colon-separated fields, with one line per user or group.

Note that on modern systems, this is not the only way to manage users. Other methods, such as LDAP or Winbind, may be used as well. The methods to use are usually configured in the  file.

The name of the  file has become a misnomer, as (hashed) passwords are now rarely stored in it. If hashed passwords are stored locally, they will be in the  file instead.

Password field
The password field in the  or   file originally consisted of a single-block DES hash of the user's password. As such, it was limited to 8 7-bit characters.

That turned out to be way too insecure. Modern systems use a different format, which begins with a dollar sign: $&lt;algorithm-id>$&lt;salt>$&lt;hashed password>

GECOS
The so-called GECOS field in the  file contains several comma-separated subfields. The subfields include the user's full name, and other information such as phone numbers.

The name GECOS is a nonsensical accident of history. It originally stood for something like General Electric Comprehensive Operating Supervisor (there is conflicting information about whether the S stood for Supervisor, or System).

Software

 * Many standard utility programs are related to reading and writing these files, including,  ,  , and.
 * Programmatically, to look up user information, the  family of C library functions may be used. (But password-related functions should probably be done via PAM instead, i.e. with pam_authenticate and related functions.)

Links

 * Passwd
 * Passwd
 * Passwd
 * Gecos field
 * IBM Knowledge Center: Using the /etc/passwd file
 * LINFO: The /etc/passwd File