xref: /original-bsd/share/man/man5/passwd.5 (revision c3e32dec)
1.\" Copyright (c) 1988, 1991, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)passwd.5	8.1 (Berkeley) 06/05/93
7.\"
8.Dd
9.Dt PASSWD 5
10.Os
11.Sh NAME
12.Nm passwd
13.Nd format of the password file
14.Sh DESCRIPTION
15The
16.Nm passwd
17files are files consisting of newline separated records, one per user,
18containing ten colon (``:'') separated fields.  These fields are as
19follows:
20.Pp
21.Bl -tag -width password -offset indent
22.It name
23User's login name.
24.It password
25User's
26.Em encrypted
27password.
28.It uid
29User's id.
30.It gid
31User's login group id.
32.It class
33User's general classification (unused).
34.It change
35Password change time.
36.It expire
37Account expiration time.
38.It gecos
39General information about the user.
40.It home_dir
41User's home directory.
42.It shell
43User's login shell.
44.El
45.Pp
46The
47.Ar name
48field is the login used to access the computer account, and the
49.Ar uid
50field is the number associated with it.  They should both be unique
51across the system (and often across a group of systems) since they
52control file access.
53.Pp
54While it is possible to have multiple entries with identical login names
55and/or identical user id's, it is usually a mistake to do so.  Routines
56that manipulate these files will often return only one of the multiple
57entries, and that one by random selection.
58.Pp
59The login name must never begin with a hyphen (``-''); also, it is strongly
60suggested that neither upper-case characters or dots (``.'') be part
61of the name, as this tends to confuse mailers.  No field may contain a
62colon (``:'') as this has been used historically to separate the fields
63in the user database.
64.Pp
65The password field is the
66.Em encrypted
67form of the password.
68If the
69.Ar password
70field is empty, no password will be required to gain access to the
71machine.  This is almost invariably a mistake.
72Because these files contain the encrypted user passwords, they should
73not be readable by anyone without appropriate privileges.
74.Pp
75The group field is the group that the user will be placed in upon login.
76Since this system supports multiple groups (see
77.Xr groups 1 )
78this field currently has little special meaning.
79.Pp
80The
81.Ar class
82field is currently unused.  In the near future it will be a key to
83a
84.Xr termcap 5
85style database of user attributes.
86.Pp
87The
88.Ar change
89field is the number in seconds,
90.Dv GMT ,
91from the epoch, until the
92password for the account must be changed.
93This field may be left empty to turn off the password aging feature.
94.Pp
95The
96.Ar expire
97field is the number in seconds,
98.Dv GMT ,
99from the epoch, until the
100account expires.
101This field may be left empty to turn off the account aging feature.
102.Pp
103The
104.Ar gecos
105field normally contains comma (``,'') separated subfields as follows:
106.Pp
107.Bd -unfilled -offset indent
108name		user's full name
109office		user's office number
110wphone		user's work phone number
111hphone		user's home phone number
112.Ed
113.Pp
114This information is used by the
115.Xr finger 1
116program.
117.Pp
118The user's home directory is the full
119.Tn UNIX
120path name where the user
121will be placed on login.
122.Pp
123The shell field is the command interpreter the user prefers.
124If there is nothing in the
125.Ar shell
126field, the Bourne shell
127.Pq Pa /bin/sh
128is assumed.
129.Sh SEE ALSO
130.Xr chpass 1 ,
131.Xr login 1 ,
132.Xr passwd 1 ,
133.Xr getpwent 3 ,
134.Xr adduser 8 ,
135.Xr pwd_mkdb 8 ,
136.Xr vipw 8
137.Sh BUGS
138User information should (and eventually will) be stored elsewhere.
139.Sh COMPATIBILITY
140The password file format has changed since 4.3BSD.
141The following awk script can be used to convert your old-style password
142file into a new style password file.
143The additional fields
144.Dq class ,
145.Dq change
146and
147.Dq expire
148are added, but are turned off by default.
149Class is currently not implemented, but change and expire are; to set them,
150use the current day in seconds from the epoch + whatever number of seconds
151of offset you want.
152.Bd -literal -offset indent
153BEGIN { FS = ":"}
154{ print $1 ":" $2 ":" $3 ":" $4 "::0:0:" $5 ":" $6 ":" $7 }
155.Ed
156.Sh HISTORY
157A
158.Nm
159file format appeared in
160.At v6 .
161