Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

login(1)

passwd(1)

crypt(3)

getpwent(3)

group(5)

adduser(8)

vipw(8)

PASSWD(5)  —  UNIX Programmer’s Manual

NAME

passwd − password file

SYNOPSIS

/etc/passwd

DESCRIPTION

For each user, the passwd file contains the following information:

login This is the user’s login name.  It contains less than nine lower-case characters. 

password This is the encrypted password. 

user ID This is the user’s unique, system ID number.  This can range from zero (reserved for root) to 65,536. 

group ID This is the group number of the group to which the user belongs.  This also ranges from zero (again reserved) to 65,536. 

name In some versions of UNIX, such as DYNIX, this field can contain the user’s office number, office telephone extension number, home telephone number, or default universe.  For historical reasons, this field is sometimes called the GCOS (General Electric’s timesharing system) field. 

directory The directory within which the user is placed when they log in.  This is known as the home directory. 

shell program to use as Shell when the user logs in. 

The user’s name field can contain &, meaning insert the login name. 

The password file is an ASCII file.  Each field within each user’s entry is separated from the next by a colon.  Each user is separated from the next by a new-line.  If the password field is null, no password is demanded; if the shell field is null, /bin/sh is used. 

The passwd file can also have line beginning with a plus (+), which means to incorporate entries from the yellow pages.  There are three styles of + entries: By itself, + means to insert the entire contents of the yellow pages password file at that point; +name means to insert the entry (if any) for name from the yellow pages at that point; +@name means to insert the entries for all members of the network group name at that point.  If a + entry has a non-null password, directory, name, or shell field, they overide what is contained in the yellow pages.  The numerical user ID and group ID fields cannot be overridden. 

EXAMPLE

Here is a sample /etc/passwd file:

root:q.mJzTnu8icF.:0:10:God:/:/bin/csh
tut:6k/7KCFRPNVXg:508:10:Bill Tuthill:/usr2/tut:/bin/csh
+john:
+@documentation:no-login:
+:::Guest

In this example, there are specific entries for users root and tut, in case the yellow pages are out of order. The user john has his password entry in the yellow pages incorporated without change; anyone in the netgroup documentation has their password field disabled, and anyone else is able to log in with their usual password, shell, and directory, but with a name field of Guest. 

The password file resides in the /etc directory.  Because the passwords are encrypted, /etc/passwd has general read permission and can be used to map numerical user ID’s to names, for example. 

Appropriate precautions must be taken to lock the /etc/passwd file against simultaneous changes if it is to be edited with a text editor; vipw(8) does the necessary locking.

FILES

/etc/passwd

SEE ALSO

login(1), passwd(1), crypt(3), getpwent(3), group(5), adduser(8), vipw(8)

4BSD

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026