xref: /netbsd-src/usr.bin/chpass/chpass.1 (revision d710132b4b8ce7f7cccaaf660cb16aa16b4077a0)
1.\"	$NetBSD: chpass.1,v 1.20 2003/02/16 16:18:23 wiz 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 February 16, 2003
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 a key for a user's login class.
184Login classes are defined in
185.Xr login.conf 5 ,
186which is a
187.Xr termcap 5
188style database of user attributes, accounting, resource and
189environment settings.
190.Pp
191The user's
192.Ar home directory
193is the full
194.Ux
195path name where the user will be placed at login.
196.Pp
197The
198.Ar shell
199field is the command interpreter the user prefers.
200If the
201.Ar shell
202field is empty, the Bourne shell,
203.Pa /bin/sh ,
204is assumed.
205When altering a login shell, and not the super-user, the user
206may not change from a non-standard shell or to a non-standard
207shell.
208Non-standard is defined as a shell not found in
209.Pa /etc/shells .
210.Pp
211The last four fields are for storing the user's
212.Ar full name , office location ,
213and
214.Ar home
215and
216.Ar work telephone
217numbers.
218.Pp
219Once the information has been verified,
220.Nm
221uses
222.Xr pwd_mkdb 8
223to update the user database.
224.Sh ENVIRONMENT
225The
226.Xr vi 1
227editor will be used unless the environment variable
228.Ev EDITOR
229is set to an alternative editor.
230When the editor terminates, the information is re-read and used to
231update the user database itself.
232Only the user, or the super-user, may edit the information associated
233with the user.
234.Sh FILES
235.Bl -tag -width /etc/master.passwd -compact
236.It Pa /etc/master.passwd
237The user database
238.It Pa /etc/passwd
239A Version 7 format password file
240.It Pa /etc/ptmp
241Lock file for the passwd database
242.It Pa /etc/pw.XXXXXX
243Temporary copy of the user passwd information
244.It Pa /etc/shells
245The list of approved shells
246.El
247.Sh SEE ALSO
248.Xr finger 1 ,
249.Xr login 1 ,
250.Xr passwd 1 ,
251.Xr getusershell 3 ,
252.Xr passwd 5 ,
253.Xr passwd.conf 5 ,
254.Xr pwd_mkdb 8 ,
255.Xr vipw 8
256.Rs
257.%A Robert Morris
258.%A Ken Thompson
259.%T "UNIX Password Security"
260.Re
261.Sh HISTORY
262The
263.Nm
264command appeared in
265.Bx 4.3 Reno .
266.Sh BUGS
267This program's interface is poorly suited to cryptographic systems such as
268Kerberos, and consequently Kerberos password changing is not a feature of
269this program.
270.Pp
271User information should (and eventually will) be stored elsewhere.
272