xref: /csrg-svn/share/man/man5/passwd.5 (revision 61609)
1*61609Sbostic.\" Copyright (c) 1988, 1991, 1993
2*61609Sbostic.\"	The Regents of the University of California.  All rights reserved.
320815Smckusick.\"
443579Strent.\" %sccs.include.redist.man%
536872Sbostic.\"
6*61609Sbostic.\"     @(#)passwd.5	8.1 (Berkeley) 06/05/93
736872Sbostic.\"
848830Scael.Dd
948830Scael.Dt PASSWD 5
1048830Scael.Os
1148830Scael.Sh NAME
1248830Scael.Nm passwd
1348830Scael.Nd format of the password file
1448830Scael.Sh DESCRIPTION
1548830ScaelThe
1648830Scael.Nm passwd
1736872Sbosticfiles are files consisting of newline separated records, one per user,
1836872Sbosticcontaining ten colon (``:'') separated fields.  These fields are as
1936872Sbosticfollows:
2048830Scael.Pp
2148830Scael.Bl -tag -width password -offset indent
2248830Scael.It name
2348830ScaelUser's login name.
2448830Scael.It password
2548830ScaelUser's
2648830Scael.Em encrypted
2748830Scaelpassword.
2848830Scael.It uid
2948830ScaelUser's id.
3048830Scael.It gid
3148830ScaelUser's login group id.
3248830Scael.It class
3348830ScaelUser's general classification (unused).
3448830Scael.It change
3548830ScaelPassword change time.
3648830Scael.It expire
3748830ScaelAccount expiration time.
3848830Scael.It gecos
3948830ScaelGeneral information about the user.
4048830Scael.It home_dir
4148830ScaelUser's home directory.
4248830Scael.It shell
4348830ScaelUser's login shell.
4448830Scael.El
4548830Scael.Pp
4636872SbosticThe
4748830Scael.Ar name
4836872Sbosticfield is the login used to access the computer account, and the
4948830Scael.Ar uid
5036872Sbosticfield is the number associated with it.  They should both be unique
5136872Sbosticacross the system (and often across a group of systems) since they
5236872Sbosticcontrol file access.
5348830Scael.Pp
5436872SbosticWhile it is possible to have multiple entries with identical login names
5536872Sbosticand/or identical user id's, it is usually a mistake to do so.  Routines
5636872Sbosticthat manipulate these files will often return only one of the multiple
5736872Sbosticentries, and that one by random selection.
5848830Scael.Pp
5937184SbosticThe login name must never begin with a hyphen (``-''); also, it is strongly
6037184Sbosticsuggested that neither upper-case characters or dots (``.'') be part
6137184Sbosticof the name, as this tends to confuse mailers.  No field may contain a
6237184Sbosticcolon (``:'') as this has been used historically to separate the fields
6337184Sbosticin the user database.
6448830Scael.Pp
6536872SbosticThe password field is the
6648830Scael.Em encrypted
6736872Sbosticform of the password.
6836872SbosticIf the
6948830Scael.Ar password
7036872Sbosticfield is empty, no password will be required to gain access to the
7136872Sbosticmachine.  This is almost invariably a mistake.
7236872SbosticBecause these files contain the encrypted user passwords, they should
7336872Sbosticnot be readable by anyone without appropriate privileges.
7448830Scael.Pp
7536872SbosticThe group field is the group that the user will be placed in upon login.
7636872SbosticSince this system supports multiple groups (see
7748830Scael.Xr groups 1 )
7836872Sbosticthis field currently has little special meaning.
7948830Scael.Pp
8036872SbosticThe
8148830Scael.Ar class
8236872Sbosticfield is currently unused.  In the near future it will be a key to
8336872Sbostica
8448830Scael.Xr termcap 5
8536872Sbosticstyle database of user attributes.
8648830Scael.Pp
8736872SbosticThe
8848830Scael.Ar change
8948830Scaelfield is the number in seconds,
9048830Scael.Dv GMT ,
9148830Scaelfrom the epoch, until the
9236872Sbosticpassword for the account must be changed.
9337670SbosticThis field may be left empty to turn off the password aging feature.
9448830Scael.Pp
9536872SbosticThe
9648830Scael.Ar expire
9748830Scaelfield is the number in seconds,
9848830Scael.Dv GMT ,
9948830Scaelfrom the epoch, until the
10036872Sbosticaccount expires.
10137670SbosticThis field may be left empty to turn off the account aging feature.
10248830Scael.Pp
10336872SbosticThe
10448830Scael.Ar gecos
10536872Sbosticfield normally contains comma (``,'') separated subfields as follows:
10648830Scael.Pp
10748830Scael.Bd -unfilled -offset indent
10848830Scaelname		user's full name
10948830Scaeloffice		user's office number
11048830Scaelwphone		user's work phone number
11148830Scaelhphone		user's home phone number
11248830Scael.Ed
11348830Scael.Pp
11436872SbosticThis information is used by the
11548830Scael.Xr finger 1
11636872Sbosticprogram.
11748830Scael.Pp
11848830ScaelThe user's home directory is the full
11948830Scael.Tn UNIX
12048830Scaelpath name where the user
12136872Sbosticwill be placed on login.
12248830Scael.Pp
12336872SbosticThe shell field is the command interpreter the user prefers.
12448830ScaelIf there is nothing in the
12548830Scael.Ar shell
12648830Scaelfield, the Bourne shell
12748830Scael.Pq Pa /bin/sh
12848830Scaelis assumed.
12948830Scael.Sh SEE ALSO
13048830Scael.Xr chpass 1 ,
13148830Scael.Xr login 1 ,
13248830Scael.Xr passwd 1 ,
13348830Scael.Xr getpwent 3 ,
13448830Scael.Xr adduser 8 ,
13548830Scael.Xr pwd_mkdb 8 ,
13648830Scael.Xr vipw 8
13748830Scael.Sh BUGS
13836872SbosticUser information should (and eventually will) be stored elsewhere.
13952684Sbostic.Sh COMPATIBILITY
14052684SbosticThe password file format has changed since 4.3BSD.
14152684SbosticThe following awk script can be used to convert your old-style password
14252684Sbosticfile into a new style password file.
14352684SbosticThe additional fields
14452684Sbostic.Dq class ,
14552684Sbostic.Dq change
14652684Sbosticand
14752684Sbostic.Dq expire
14852684Sbosticare added, but are turned off by default.
14952684SbosticClass is currently not implemented, but change and expire are; to set them,
15052684Sbosticuse the current day in seconds from the epoch + whatever number of seconds
15152684Sbosticof offset you want.
15252684Sbostic.Bd -literal -offset indent
15352684SbosticBEGIN { FS = ":"}
15452684Sbostic{ print $1 ":" $2 ":" $3 ":" $4 "::0:0:" $5 ":" $6 ":" $7 }
15552684Sbostic.Ed
15648830Scael.Sh HISTORY
15748830ScaelA
15848830Scael.Nm
15948830Scaelfile format appeared in
16048830Scael.At v6 .
161