1 .\" $NetBSD: passwd.5,v 1.27 2007/06/21 15:12:59 ginsbach Exp $
3 .\" Copyright (c) 1988, 1991, 1993
4 .\" The Regents of the University of California. All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
14 .\" 3. Neither the name of the University nor the names of its contributors
15 .\" may be used to endorse or promote products derived from this software
16 .\" without specific prior written permission.
18 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" Portions Copyright (c) 1994, Jason Downs. All rights reserved.
32 .\" Redistribution and use in source and binary forms, with or without
33 .\" modification, are permitted provided that the following conditions
35 .\" 1. Redistributions of source code must retain the above copyright
36 .\" notice, this list of conditions and the following disclaimer.
37 .\" 2. Redistributions in binary form must reproduce the above copyright
38 .\" notice, this list of conditions and the following disclaimer in the
39 .\" documentation and/or other materials provided with the distribution.
41 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS
42 .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
43 .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
44 .\" DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT,
45 .\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
46 .\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
47 .\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
48 .\" CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
53 .\" @(#)passwd.5 8.1 (Berkeley) 6/5/93
61 .Nd format of the password file
65 files are the local source of password information.
66 They can be used in conjunction with the Hesiod domain
73 .Sq master.passwd.byname ,
75 .Sq master.passwd.byuid ,
81 file is readable only by root, and consists of newline separated
83 records, one per user, containing ten colon
87 Each line has the form:
88 .Dl name:password:uid:gid:class:change:expire:gecos:home_dir:shell
90 These fields are as follows:
91 .Bl -tag -width password -offset indent -compact
101 User's login group id.
105 Password change time.
107 Account expiration time.
109 General information about the user.
111 User's home directory.
116 Be aware that each line is limited to 1024 characters; longer ones will be
118 This limit can be queried through
121 .Li _SC_GETPW_R_SIZE_MAX
126 file is generated from the
135 fields removed, and the
142 field is the login used to access the computer account, and the
144 field is the number associated with it.
145 They should both be unique across the system (and often across a
146 group of systems) since they control file access.
148 While it is possible to have multiple entries with identical login names
149 and/or identical user id's, it is usually a mistake to do so.
150 Routines that manipulate these files will often return only one of
151 the multiple entries, and that one by random selection.
153 The login name must never begin with a hyphen
155 also, it is strongly suggested that neither upper-case characters nor dots
157 be part of the name, as this tends to confuse mailers.
158 No field may contain a colon
160 as this has been used historically to separate the fields in the user database.
166 form of the password.
169 field is empty, no password will be required to gain access to the
171 This is almost invariably a mistake.
172 Because these files contain the encrypted user passwords, they should
173 not be readable by anyone without appropriate privileges.
174 For the possible ciphers used in this field see
179 field is the group that the user will be placed in upon login.
180 Since this system supports multiple groups (see
182 this field currently has little special meaning.
186 field is a key for a user's login class.
187 Login classes are defined in
191 style database of user attributes, accounting, resource and
192 environment settings.
196 field is the number of seconds from the epoch,
199 password for the account must be changed.
200 This field may be left empty to turn off the password aging feature.
203 then the user will be prompted to change their password at the next
208 field is the number of seconds from the epoch,
212 This field may be left empty to turn off the account aging feature.
218 fields are set, the system will remind the user of the impending
219 change or expiry if they login within a configurable period
220 (defaulting to 14 days) before the event.
224 field normally contains comma
226 separated subfields as follows:
228 .Bl -tag -width office -offset indent -compact
234 user's work phone number
236 user's home phone number
239 The full name may contain an ampersand
241 which will be replaced by
242 the capitalized login name when the gecos field is displayed or used
243 by various programs such as
248 The office and phone number subfields are used by the
250 program, and possibly other applications.
252 The user's home directory is the full
254 path name where the user
255 will be placed on login.
257 The shell field is the command interpreter the user prefers.
258 If there is nothing in the
260 field, the Bourne shell
269 .Xr nsswitch.conf 5 ,
272 lookups occur from the
281 .Xr nsswitch.conf 5 ,
284 lookups occur from the
287 .Sq master.passwd.byname ,
289 .Sq master.passwd.byuid
304 .Xr nsswitch.conf 5 ,
307 file also supports standard
309 exclusions and inclusions, based on user names and netgroups.
311 Lines beginning with a minus sign
313 are entries marked as being excluded from any following inclusions,
314 which are marked with a plus sign
317 If the second character of the line is an at sign
320 involves the user fields of all entries in the netgroup specified by the
321 remaining characters of the
324 Otherwise, the remainder of the
326 field is assumed to be a specific user name.
330 token may also be alone in the
332 field, which causes all users from either the Hesiod domain
335 .Sq passwd_compat: dns )
342 .Sq passwd_compat: nis )
345 If the entry contains non-empty
349 fields, the specified numbers will override the information retrieved
350 from the Hesiod domain or the
358 entries contain text, it will override the information included via
363 field may also be overridden.
371 .Xr login_getclass 3 ,
380 .%T "Managing NFS and NIS"
381 (O'Reilly \*[Am] Associates)
383 The password file format has changed since
385 The following awk script can be used to convert your old-style password
386 file into a new style password file.
387 The additional fields
392 are added, but are turned off by default.
394 use the current day in seconds from the epoch + whatever number of seconds
396 .Bd -literal -offset indent
398 { print $1 ":" $2 ":" $3 ":" $4 "::0:0:" $5 ":" $6 ":" $7 }
403 file format appeared in
409 file format first appeared in SunOS.
411 The Hesiod support first appeared in
416 capability first appeared in
419 User information should (and eventually will) be stored elsewhere.
423 exclusions in the file after any inclusions will have