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