1.\" Copyright (c) 1988, 1990, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" %sccs.include.redist.man% 5.\" 6.\" @(#)chpass.1 8.2 (Berkeley) 12/30/93 7.\" 8.Dd 9.Dt CHPASS 1 10.Os 11.Sh NAME 12.Nm chpass 13.Nd add or change user database information 14.Sh SYNOPSIS 15chpass 16.Op Fl a Ar list 17.Op Fl s Ar newshell 18.Op user 19.Sh DESCRIPTION 20.Nm Chpass 21allows editing of the user database information associated 22with 23.Ar user 24or, by default, the current user. 25The information is formatted and supplied to an editor for changes. 26.Pp 27Only the information that the user is allowed to change is displayed. 28.Pp 29The options are as follows: 30.Bl -tag -width Ds 31.It Fl a 32The super-user is allowed to directly supply a user database 33entry, in the format specified by 34.Xr passwd 5 , 35as an argument. 36This argument must be a colon (``:'') separated list of all the 37user database fields, although they may be empty. 38.It Fl s 39The 40.Fl s 41option attempts to change the user's shell to 42.Ar newshell . 43.El 44.Pp 45Possible display items are as follows: 46.Pp 47.Bl -tag -width "Home Directory:" -compact -offset indent 48.It Login: 49user's login name 50.It Password: 51user's encrypted password 52.It Uid: 53user's login 54.It Gid: 55user's login group 56.It Change: 57password change time 58.It Expire: 59account expiration time 60.It Class: 61user's general classification 62.It Home Directory: 63user's home directory 64.It Shell: 65user's login shell 66.It Full Name: 67user's real name 68.It Location: 69user's normal location 70.It Home Phone: 71user's home phone 72.It Office Phone: 73user's office phone 74.El 75.Pp 76The 77.Ar login 78field is the user name used to access the computer account. 79.Pp 80The 81.Ar password 82field contains the encrypted form of the user's password. 83.Pp 84The 85.Ar uid 86field is the number associated with the 87.Ar login 88field. 89Both of these fields should be unique across the system (and often 90across a group of systems) as they control file access. 91.Pp 92While it is possible to have multiple entries with identical login names 93and/or identical user id's, it is usually a mistake to do so. Routines 94that manipulate these files will often return only one of the multiple 95entries, and that one by random selection. 96.Pp 97The 98.Ar group 99field is the group that the user will be placed in at login. 100Since BSD supports multiple groups (see 101.Xr groups 1 ) 102this field currently has little special meaning. 103This field may be filled in with either a number or a group name (see 104.Xr group 5 ) . 105.Pp 106The 107.Ar change 108field is the date by which the password must be changed. 109.Pp 110The 111.Ar expire 112field is the date on which the account expires. 113.Pp 114Both the 115.Ar change 116and 117.Ar expire 118fields should be entered in the form ``month day year'' where 119.Ar month 120is the month name (the first three characters are sufficient), 121.Ar day 122is the day of the month, and 123.Ar year 124is the year. 125.Pp 126The 127.Ar class 128field is currently unused. In the near future it will be a key to 129a 130.Xr termcap 5 131style database of user attributes. 132.Pp 133The user's 134.Ar home directory 135is the full UNIX path name where the user 136will be placed at login. 137.Pp 138The 139.Ar shell 140field is the command interpreter the user prefers. 141If the 142.Ar shell 143field is empty, the Bourne shell, 144.Pa /bin/sh , 145is assumed. 146When altering a login shell, and not the super-user, the user 147may not change from a non-standard shell or to a non-standard 148shell. 149Non-standard is defined as a shell not found in 150.Pa /etc/shells . 151.Pp 152The last four fields are for storing the user's 153.Ar full name , office location , 154and 155.Ar home 156and 157.Ar work telephone 158numbers. 159.Pp 160Once the information has been verified, 161.Nm chpass 162uses 163.Xr pwd_mkdb 8 164to update the user database. 165.Sh ENVIRONMENT 166The 167.Xr vi 1 168editor will be used unless the environment variable EDITOR is set to 169an alternate editor. 170When the editor terminates, the information is re-read and used to 171update the user database itself. 172Only the user, or the super-user, may edit the information associated 173with the user. 174.Sh FILES 175.Bl -tag -width /etc/master.passwd -compact 176.It Pa /etc/master.passwd 177The user database 178.It Pa /etc/passwd 179A Version 7 format password file 180.It Pa /etc/chpass.XXXXXX 181Temporary copy of the password file 182.It Pa /etc/shells 183The list of approved shells 184.El 185.Sh SEE ALSO 186.Xr login 1 , 187.Xr finger 1 , 188.Xr passwd 1 , 189.Xr getusershell 3 , 190.Xr passwd 5 , 191.Xr pwd_mkdb 8 , 192.Xr vipw 8 193.Rs 194.%A Robert Morris 195and 196.%A Ken Thompson 197.%T "UNIX Password security" 198.Re 199.Sh BUGS 200User information should (and eventually will) be stored elsewhere. 201.Sh HISTORY 202The 203.Nm 204command appeared in 205.Bx 4.3 Reno . 206