1.\" $NetBSD: passwd.5,v 1.3 1994/11/30 19:31:24 jtc Exp $ 2.\" 3.\" Copyright (c) 1988, 1991, 1993 4.\" The Regents of the University of California. All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: 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. All advertising materials mentioning features or use of this software 15.\" must display the following acknowledgement: 16.\" This product includes software developed by the University of 17.\" California, Berkeley and its contributors. 18.\" 4. Neither the name of the University nor the names of its contributors 19.\" may be used to endorse or promote products derived from this software 20.\" without specific prior written permission. 21.\" 22.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 23.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 26.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32.\" SUCH DAMAGE. 33.\" 34.\" @(#)passwd.5 8.1 (Berkeley) 6/5/93 35.\" 36.Dd June 5, 1993 37.Dt PASSWD 5 38.Os 39.Sh NAME 40.Nm passwd 41.Nd format of the password file 42.Sh DESCRIPTION 43The 44.Nm passwd 45files are files consisting of newline separated records, one per user, 46containing ten colon (``:'') separated fields. These fields are as 47follows: 48.Pp 49.Bl -tag -width password -offset indent 50.It name 51User's login name. 52.It password 53User's 54.Em encrypted 55password. 56.It uid 57User's id. 58.It gid 59User's login group id. 60.It class 61User's general classification (unused). 62.It change 63Password change time. 64.It expire 65Account expiration time. 66.It gecos 67General information about the user. 68.It home_dir 69User's home directory. 70.It shell 71User's login shell. 72.El 73.Pp 74The 75.Ar name 76field is the login used to access the computer account, and the 77.Ar uid 78field is the number associated with it. They should both be unique 79across the system (and often across a group of systems) since they 80control file access. 81.Pp 82While it is possible to have multiple entries with identical login names 83and/or identical user id's, it is usually a mistake to do so. Routines 84that manipulate these files will often return only one of the multiple 85entries, and that one by random selection. 86.Pp 87The login name must never begin with a hyphen (``-''); also, it is strongly 88suggested that neither upper-case characters or dots (``.'') be part 89of the name, as this tends to confuse mailers. No field may contain a 90colon (``:'') as this has been used historically to separate the fields 91in the user database. 92.Pp 93The password field is the 94.Em encrypted 95form of the password. 96If the 97.Ar password 98field is empty, no password will be required to gain access to the 99machine. This is almost invariably a mistake. 100Because these files contain the encrypted user passwords, they should 101not be readable by anyone without appropriate privileges. 102.Pp 103The group field is the group that the user will be placed in upon login. 104Since this system supports multiple groups (see 105.Xr groups 1 ) 106this field currently has little special meaning. 107.Pp 108The 109.Ar class 110field is currently unused. In the near future it will be a key to 111a 112.Xr termcap 5 113style database of user attributes. 114.Pp 115The 116.Ar change 117field is the number in seconds, 118.Dv GMT , 119from the epoch, until the 120password for the account must be changed. 121This field may be left empty to turn off the password aging feature. 122.Pp 123The 124.Ar expire 125field is the number in seconds, 126.Dv GMT , 127from the epoch, until the 128account expires. 129This field may be left empty to turn off the account aging feature. 130.Pp 131The 132.Ar gecos 133field normally contains comma (``,'') separated subfields as follows: 134.Pp 135.Bd -unfilled -offset indent 136name user's full name 137office user's office number 138wphone user's work phone number 139hphone user's home phone number 140.Ed 141.Pp 142This information is used by the 143.Xr finger 1 144program. 145.Pp 146The user's home directory is the full 147.Tn UNIX 148path name where the user 149will be placed on login. 150.Pp 151The shell field is the command interpreter the user prefers. 152If there is nothing in the 153.Ar shell 154field, the Bourne shell 155.Pq Pa /bin/sh 156is assumed. 157.Sh SEE ALSO 158.Xr chpass 1 , 159.Xr login 1 , 160.Xr passwd 1 , 161.Xr getpwent 3 , 162.Xr adduser 8 , 163.Xr pwd_mkdb 8 , 164.Xr vipw 8 165.Sh BUGS 166User information should (and eventually will) be stored elsewhere. 167.Sh COMPATIBILITY 168The password file format has changed since 4.3BSD. 169The following awk script can be used to convert your old-style password 170file into a new style password file. 171The additional fields 172.Dq class , 173.Dq change 174and 175.Dq expire 176are added, but are turned off by default. 177Class is currently not implemented, but change and expire are; to set them, 178use the current day in seconds from the epoch + whatever number of seconds 179of offset you want. 180.Bd -literal -offset indent 181BEGIN { FS = ":"} 182{ print $1 ":" $2 ":" $3 ":" $4 "::0:0:" $5 ":" $6 ":" $7 } 183.Ed 184.Sh HISTORY 185A 186.Nm 187file format appeared in 188.At v6 . 189