Bogus ioctl arguments fixed.
[unix-history] / usr.bin / chpass / chpass.1
CommitLineData
15637ed4
RG
1.\" Copyright (c) 1988, 1990 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\" notice, this list of conditions and the following disclaimer in the
11.\" documentation and/or other materials provided with the distribution.
12.\" 3. All advertising materials mentioning features or use of this software
13.\" must display the following acknowledgement:
14.\" This product includes software developed by the University of
15.\" California, Berkeley and its contributors.
16.\" 4. Neither the name of the University nor the names of its contributors
17.\" may be used to endorse or promote products derived from this software
18.\" without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" @(#)chpass.1 5.11 (Berkeley) 3/14/91
33.\"
34.\" PATCHES MAGIC LEVEL PATCH THAT GOT US HERE
35.\" -------------------- ----- ----------------------
36.\" CURRENT PATCH LEVEL: 1 00130
37.\" -------------------- ----- ----------------------
38.\"
39.\" 06 Apr 93 Sascha Wildner Misc small fixes
40.\"
41.Dd March 14, 1991
42.Dt CHPASS 1
43.Os
44.Sh NAME
45.Nm chpass
46.Nd add or change user database information
47.Sh SYNOPSIS
48chpass
49.Op Fl a Ar list
50.Op Fl s Ar shell
51.Op user
52.Sh DESCRIPTION
53.Nm Chpass
54allows editing of the user database information associated
55with
56.Ar user
57or, by default, the current user.
58The information is formatted and supplied to an editor for changes.
59.Pp
60Only the information that the user is allowed to change is displayed.
61.Pp
62The options are as follows:
63.Bl -tag -width Ds
64.It Fl a
65The super-user is allowed to directly supply a user database
66entry, in the format specified by
67.Xr passwd 5 ,
68as an argument.
69This argument must be a colon (``:'') separated list of all the
70user database fields, although they may be empty.
71.It Fl s
72The
73.Fl s
74option attempts to change the user's shell to
75.Ar shell .
76.El
77.Pp
78Possible display items are as follows:
79.Pp
80.Bl -tag -width "Home Directory:" -compact -offset indent
81.It Login:
82user's login name
83.It Password:
84user's encrypted password
85.It Uid:
86user's id
87.It Gid:
88user's login group id
89.It Change:
90password change time
91.It Expire:
92account expiration time
93.It Class:
94user's general classification
95.It Home Directory:
96user's home directory
97.It Shell:
98user's login shell
99.It Full Name:
100user's real name
101.It Location:
102user's normal location
103.It Home Phone:
104user's home phone
105.It Office Phone:
106user's office phone
107.El
108.Pp
109The
110.Ar login
111field is the user name used to access the computer account.
112.Pp
113The
114.Ar password
115field contains the encrypted form of the user's password.
116.Pp
117The
118.Ar uid
119field is the number associated with the
120.Ar login
121field.
122Both of these fields should be unique across the system (and often
123across a group of systems) as they control file access.
124.Pp
125While it is possible to have multiple entries with identical login names
126and/or identical user id's, it is usually a mistake to do so. Routines
127that manipulate these files will often return only one of the multiple
128entries, and that one by random selection.
129.Pp
130The
131.Ar group
132field is the group that the user will be placed in at login.
133Since this system supports multiple groups (see
134.Xr groups 1 )
135this field currently has little special meaning.
136This field may be filled in with either a number or a group name (see
137.Xr group 5 ) .
138.Pp
139The
140.Ar change
141field is the date by which the password must be changed.
142.Pp
143The
144.Ar expire
145field is the date on which the account expires.
146.Pp
147Both the
148.Ar change
149and
150.Ar expire
151fields should be entered in the form ``month day year'' where
152.Ar month
153is the month name (the first three characters are sufficient),
154.Ar day
155is the day of the month, and
156.Ar year
157is the year.
158.Pp
159The
160.Ar class
161field is currently unused. In the near future it will be a key to
162a
163.Xr termcap 5
164style database of user attributes.
165.Pp
166The user's
167.Ar home directory
168is the full UNIX path name where the user
169will be placed at login.
170.Pp
171The
172.Ar shell
173field is the command interpreter the user prefers.
174If the
175.Ar shell
176field is empty, the Bourne shell,
177.Pa /bin/sh ,
178is assumed.
179When altering a login shell, and not the super-user, the user
180may not change from a non-standard shell or to a non-standard
181shell.
182Non-standard is defined as a shell not found in
183.Pa /etc/shells .
184.Pp
185The last four fields are for storing the user's
186.Ar full name , office location ,
187and
188.Ar home
189and
190.Ar work telephone
191numbers.
192.Pp
193Once the information has been verified,
194.Nm chpass
195uses
196.Xr pwd_mkdb 8
197to update the user database.
198.Sh ENVIRONMENT
199The
200.Xr vi 1
201editor will be used unless the environment variable EDITOR is set to
202an alternate editor.
203When the editor terminates, the information is re-read and used to
204update the user database itself.
205Only the user, or the super-user, may edit the information associated
206with the user.
207.Sh FILES
208.Bl -tag -width /etc/master.passwd -compact
209.It Pa /etc/master.passwd
210The user database
211.It Pa /etc/passwd
212A Version 7 format password file
213.It Pa /etc/chpass.XXXXXX
214Temporary copy of the password file
215.It Pa /etc/shells
216The list of approved shells
217.El
218.Sh SEE ALSO
219.Xr login 1 ,
220.Xr finger 1 ,
221.Xr passwd 1 ,
222.Xr getusershell 3 ,
223.Xr passwd 5 ,
224.Xr pwd_mkdb 8 ,
225.Xr vipw 8
226.Rs
227.%A Robert Morris
228.%A Ken Thompson
229.%T "UNIX Password security"
230.Re
231.Sh BUGS
232User information should (and eventually will) be stored elsewhere.
233.Sh HISTORY
234The
235.Nm
236command appeared in
237.Bx 4.3 Reno .