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