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. Neither the name of the University nor the names of its contributors
16 .\" may be used to endorse or promote products derived from this software
17 .\" without specific prior written permission.
19 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
39 .Nd format of the password file
43 files are the local source of password information.
44 They can be used in conjunction with the Hesiod domains
51 .Sq Li passwd.byname ,
53 .Sq Li master.passwd.byname ,
55 .Sq Li master.passwd.byuid ,
59 For consistency, none of these files should ever be modified
64 file is readable only by root, and consists of newline separated
65 records, one per user, containing ten colon
69 These fields are as follows:
70 .Bl -tag -width ".Ar password" -offset indent
80 User's login group id.
86 Account expiration time.
88 General information about the user.
90 User's home directory.
97 file is generated from the
106 fields removed, and the
114 field is the login used to access the computer account, and the
116 field is the number associated with it.
117 They should both be unique
118 across the system (and often across a group of systems) since they
121 While it is possible to have multiple entries with identical login names
122 and/or identical user id's, it is usually a mistake to do so.
124 that manipulate these files will often return only one of the multiple
125 entries, and that one by random selection.
127 The login name must not begin with a hyphen
129 and cannot contain 8-bit characters, tabs or spaces, or any of these
131 .Ql \&,:+&#%^\&(\&)!@~*?<>=|\e\\&/"\&; .
134 is allowed only as the last character for use with Samba.
135 No field may contain a
138 as this has been used historically to separate the fields
139 in the user database.
146 represent different users.
147 Be aware of this when interoperating with systems that do not have
148 case-sensitive login names.
157 form of the password, see
161 field is empty, no password will be required to gain access to the
163 This is almost invariably a mistake, so authentication components
164 such as PAM can forcibly disallow remote access to passwordless accounts.
165 Because this file contains the encrypted user passwords, it should
166 not be readable by anyone without appropriate privileges.
171 password authentication is disabled for that account
172 (logins through other forms of
173 authentication, e.g., using
175 keys, will still work).
176 The field only contains encrypted passwords, and
178 can never be the result of encrypting a password.
180 An encrypted password prefixed by
182 means that the account is temporarily locked out
183 and no one can log into it using any authentication.
184 For a convenient command-line interface to account locking, see
189 field is the group that the user will be placed in upon login.
190 Since this system supports multiple groups (see
192 this field currently has little special meaning.
196 field is a key for a user's login class.
202 style database of user attributes, accounting, resource,
203 and environment settings.
207 field is the number of seconds from the epoch,
210 password for the account must be changed.
211 This field may be left empty to turn off the password aging feature;
212 a value of zero is equivalent to leaving the field empty.
216 field is the number of seconds from the epoch,
220 This field may be left empty to turn off the account aging feature;
221 a value of zero is equivalent to leaving the field empty.
225 field normally contains comma
227 separated subfields as follows:
229 .Bl -tag -width ".Ar office" -offset indent -compact
235 user's work phone number
237 user's home phone number
242 may contain an ampersand
244 which will be replaced by
245 the capitalized login
249 field is displayed or used
250 by various programs such as
257 and phone number subfields are used by the
259 program, and possibly other applications.
261 The user's home directory,
265 path name where the user
266 will be placed on login.
270 field is the command interpreter the user prefers.
271 If there is nothing in the
273 field, the Bourne shell
276 The conventional way to disable logging into an account once and for all,
277 as it is done for system accounts,
282 .Pq see Xr nologin 8 .
289 .Xr nsswitch.conf 5 ,
292 lookups occur from the
301 .Xr nsswitch.conf 5 ,
304 lookups occur from the
305 .Sq Li passwd.byname ,
306 .Sq Li passwd.byuid ,
307 .Sq Li master.passwd.byname ,
309 .Sq Li master.passwd.byuid
324 .Xr nsswitch.conf 5 ,
327 file also supports standard
328 .Sq Li + Ns / Ns Li -
329 exclusions and inclusions, based on user names and netgroups.
331 Lines beginning with a
333 (minus sign) are entries marked as being excluded
334 from any following inclusions, which are marked with a
338 If the second character of the line is a
340 (at sign), the operation
341 involves the user fields of all entries in the netgroup specified by the
342 remaining characters of the
345 Otherwise, the remainder of the
347 field is assumed to be a specific user name.
351 token may also be alone in the
353 field, which causes all users from either the Hesiod domain
356 .Sq Li passwd_compat: dns )
363 .Sq Li passwd_compat: nis )
366 If the entry contains non-empty
370 fields, the specified numbers will override the information retrieved
371 from the Hesiod domain or the
379 entries contain text, it will override the information included via
384 field may also be overridden.
386 .Bl -tag -width ".Pa /etc/master.passwd" -compact
389 password file, with passwords removed
392 password database, with passwords removed
393 .It Pa /etc/master.passwd
395 password file, with passwords intact
398 password database, with passwords intact
401 The password file format has changed since
403 The following awk script can be used to convert your old-style password
404 file into a new style password file.
405 The additional fields
410 are added, but are turned off by default
411 .Pq setting these fields to zero is equivalent to leaving them blank .
412 Class is currently not implemented, but change and expire are; to set them,
413 use the current day in seconds from the epoch + whatever number of seconds
415 .Bd -literal -offset indent
417 { print $1 ":" $2 ":" $3 ":" $4 "::0:0:" $5 ":" $6 ":" $7 }
427 .Xr nsswitch.conf 5 ,
435 .%T "Managing NFS and NIS"
436 (O'Reilly & Associates)
440 file format first appeared in
446 file format first appeared in SunOS.
448 The Hesiod support first appeared in
450 It was imported from the
452 Project, where it first appeared in
455 User information should (and eventually will) be stored elsewhere.
459 exclusions in the file after any inclusions will have