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