1 .\" $NetBSD: passwd.5,v 1.12.2.2 1999/12/17 23:14:50 he Exp $
3 .\" Copyright (c) 1988, 1991, 1993
4 .\" The Regents of the University of California. All rights reserved.
5 .\" Portions Copyright (c) 1994, Jason Downs. All rights reserved.
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\" notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\" notice, this list of conditions and the following disclaimer in the
14 .\" documentation and/or other materials provided with the distribution.
15 .\" 3. All advertising materials mentioning features or use of this software
16 .\" must display the following acknowledgement:
17 .\" This product includes software developed by the University of
18 .\" California, Berkeley and its contributors.
19 .\" 4. Neither the name of the University nor the names of its contributors
20 .\" may be used to endorse or promote products derived from this software
21 .\" without specific prior written permission.
23 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 .\" From: @(#)passwd.5 8.1 (Berkeley) 6/5/93
36 .\" $FreeBSD: src/share/man/man5/passwd.5,v 1.50 2007/05/08 11:00:07 yar Exp $
37 .\" $DragonFly: src/share/man/man5/passwd.5,v 1.9 2008/05/02 02:05:06 swildner Exp $
45 .Nd format of the password file
49 files are the local source of password information.
50 They can be used in conjunction with the Hesiod domains
57 .Sq Li passwd.byname ,
59 .Sq Li master.passwd.byname ,
61 .Sq Li master.passwd.byuid ,
65 For consistency, none of these files should ever be modified
70 file is readable only by root, and consists of newline separated
71 records, one per user, containing ten colon
75 These fields are as follows:
76 .Bl -tag -width ".Ar password" -offset indent
86 User's login group id.
92 Account expiration time.
94 General information about the user.
96 User's home directory.
103 file is generated from the
112 fields removed, and the
120 field is the login used to access the computer account, and the
122 field is the number associated with it.
123 They should both be unique
124 across the system (and often across a group of systems) since they
127 While it is possible to have multiple entries with identical login names
128 and/or identical user id's, it is usually a mistake to do so.
130 that manipulate these files will often return only one of the multiple
131 entries, and that one by random selection.
133 The login name must never begin with a hyphen
136 suggested that neither upper-case characters or dots
139 of the name, as this tends to confuse mailers.
140 No field may contain a
143 as this has been used historically to separate the fields
144 in the user database.
153 form of the password, see
157 field is empty, no password will be required to gain access to the
159 This is almost invariably a mistake, so authentication components
160 such as PAM can forcibly disallow remote access to passwordless accounts.
161 Because this file contains the encrypted user passwords, it should
162 not be readable by anyone without appropriate privileges.
167 password authentication is disabled for that account
168 (logins through other forms of
169 authentication, e.g., using
171 keys, will still work).
172 The field only contains encrypted passwords, and
174 can never be the result of encrypting a password.
176 An encrypted password prefixed by
178 means that the account is temporarily locked out
179 and no one can log into it using any authentication.
180 For a convenient command-line interface to account locking, see
185 field is the group that the user will be placed in upon login.
186 Since this system supports multiple groups (see
188 this field currently has little special meaning.
192 field is a key for a user's login class.
198 style database of user attributes, accounting, resource,
199 and environment settings.
203 field is the number of seconds from the epoch,
206 password for the account must be changed.
207 This field may be left empty to turn off the password aging feature.
211 field is the number of seconds from the epoch,
215 This field may be left empty to turn off the account aging feature.
219 field normally contains comma
221 separated subfields as follows:
223 .Bl -tag -width ".Ar office" -offset indent -compact
229 user's work phone number
231 user's home phone number
236 may contain a ampersand
238 which will be replaced by
239 the capitalized login
243 field is displayed or used
244 by various programs such as
251 and phone number subfields are used by the
253 program, and possibly other applications.
255 The user's home directory,
259 path name where the user
260 will be placed on login.
264 field is the command interpreter the user prefers.
265 If there is nothing in the
267 field, the Bourne shell
270 The conventional way to disable logging into an account once and for all,
271 as it is done for system accounts,
282 .Xr nsswitch.conf 5 ,
285 lookups occur from the
294 .Xr nsswitch.conf 5 ,
297 lookups occur from the
298 .Sq Li passwd.byname ,
299 .Sq Li passwd.byuid ,
300 .Sq Li master.passwd.byname ,
302 .Sq Li master.passwd.byuid
317 .Xr nsswitch.conf 5 ,
320 file also supports standard
321 .Sq Li + Ns / Ns Li -
322 exclusions and inclusions, based on user names and netgroups.
324 Lines beginning with a
326 (minus sign) are entries marked as being excluded
327 from any following inclusions, which are marked with a
331 If the second character of the line is a
333 (at sign), the operation
334 involves the user fields of all entries in the netgroup specified by the
335 remaining characters of the
338 Otherwise, the remainder of the
340 field is assumed to be a specific user name.
344 token may also be alone in the
346 field, which causes all users from either the Hesiod domain
349 .Sq Li passwd_compat: dns )
356 .Sq Li passwd_compat: nis )
359 If the entry contains non-empty
363 fields, the specified numbers will override the information retrieved
364 from the Hesiod domain or the
372 entries contain text, it will override the information included via
377 field may also be overridden.
379 .Bl -tag -width ".Pa /etc/master.passwd" -compact
382 password file, with passwords removed
385 password database, with passwords removed
386 .It Pa /etc/master.passwd
388 password file, with passwords intact
391 password database, with passwords intact
394 The password file format has changed since
396 The following awk script can be used to convert your old-style password
397 file into a new style password file.
398 The additional fields
403 are added, but are turned off by default.
404 Class is currently not implemented, but change and expire are; to set them,
405 use the current day in seconds from the epoch + whatever number of seconds
407 .Bd -literal -offset indent
409 { print $1 ":" $2 ":" $3 ":" $4 "::0:0:" $5 ":" $6 ":" $7 }
419 .Xr nsswitch.conf 5 ,
427 .%T "Managing NFS and NIS"
428 (O'Reilly & Associates)
432 file format appeared in
438 file format first appeared in SunOS.
440 The Hesiod support first appeared in
442 It was imported from the
444 Project, where it first appeared in
447 User information should (and eventually will) be stored elsewhere.
451 exclusions in the file after any inclusions will have