better error messages when user's editor doesn't exist
[unix-history] / usr / src / usr.bin / chpass / chpass.1
CommitLineData
0568f98e
KB
1.\" Copyright (c) 1988 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms are permitted
5.\" provided that the above copyright notice and this paragraph are
6.\" duplicated in all such forms and that any documentation,
7.\" advertising materials, and other materials related to such
8.\" distribution and use acknowledge that the software was developed
9.\" by the University of California, Berkeley. The name of the
10.\" University may not be used to endorse or promote products derived
11.\" from this software without specific prior written permission.
12.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
13.\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
14.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
15.\"
34dda72c 16.\" @(#)chpass.1 5.7 (Berkeley) %G%
0568f98e
KB
17.\"
18.TH CHPASS 1 ""
19.UC 4
20.SH NAME
21chpass \- add or change user database information
22.SH SYNOPSIS
34dda72c 23chpass [ -a list ] [ -s shell ] [ user ]
0568f98e
KB
24.SH DESCRIPTION
25.I Chpass
26allows editing of the user database information associated
27with
28.I user
29or, by default, the current user.
30The information is formatted and supplied to an editor for changes.
31The
32.I vi
b7eb8299 33editor will be used unless the environmental variable EDITOR selects
0568f98e
KB
34an alternate editor.
35When the editor terminates, the information is re-read and used to
36update the user database itself.
37Only the user, or the super-user, may edit the information associated
38with the user.
39.PP
40Only the information that the user is allowed to change is displayed.
41.PP
74086f3a
KB
42Possible display items are as follows:
43.PP
44.RS
45 Login: user's login name
b7eb8299 46 Password: user's encrypted password
74086f3a
KB
47 Uid: user's id
48 Gid: user's login group id
49 Change: password change time
50 Expire: account expiration time
51 Class: user's general classification
52 Home Directory: user's home directory
53 Shell: user's login shell
54 Full Name: user's real name
55 Location: user's normal location
56 Home Phone: user's home phone
57 Office Phone: user's office phone
58.RE
59.PP
60.PP
61The
b7eb8299
KB
62.I login
63field is the user name used to access the computer account.
64.PP
65The
66.I password
67field contains the encrypted form of the user's password.
68.PP
69The
74086f3a 70.I uid
b7eb8299
KB
71field is the number associated with the
72.I login
73field.
74Both of these fields should be unique across the system (and often
75across a group of systems) as they control file access.
74086f3a
KB
76.PP
77While it is possible to have multiple entries with identical login names
78and/or identical user id's, it is usually a mistake to do so. Routines
79that manipulate these files will often return only one of the multiple
80entries, and that one by random selection.
81.PP
82The
83.I group
34dda72c 84field is the group that the user will be placed in at login.
74086f3a
KB
85Since this system supports multiple groups (see
86.IR groups (1))
87this field currently has little special meaning.
88This field may be filled in with either a number or a group name (see
89.IR group (5)).
90.PP
91The
92.I change
7f554f7b 93field is the date by which the password must be changed.
74086f3a
KB
94.PP
95The
96.I expire
7f554f7b 97field is the date on which the account expires.
74086f3a
KB
98.PP
99Both the
100.I change
101and
102.I expire
ef97d022 103fields should be entered in the form ``month day year'' where
74086f3a 104.I month
7f554f7b 105is the month name (the first three characters are sufficient),
ef97d022 106.I day
d264b2a3 107is the day of the month, and
ef97d022 108.I year
7f554f7b 109is the year.
74086f3a
KB
110.PP
111The
112.I class
113field is currently unused. In the near future it will be a key to
114a
115.IR termcap (5)
116style database of user attributes.
117.PP
118The user's home directory is the full UNIX path name where the user
34dda72c 119will be placed at login.
74086f3a
KB
120.PP
121The shell field is the command interpreter the user prefers.
122If the
123.I shell
124field is empty, the Bourne shell (\fI/bin/sh\fP) is assumed.
34dda72c
KB
125When altering a login shell, and not the super-user, the user
126may not change from a non-standard shell or to a non-standard
127shell.
128Non-standard is defined as a shell not found in
0568f98e
KB
129.IR /etc/shells .
130.PP
74086f3a
KB
131The last four fields are for storing the user's full name, office
132location, and home and work telephone numbers.
133.PP
34dda72c
KB
134The options are as follows:
135.TP
136.I -a
137The super-user is allowed to directly supply a user database
b7eb8299
KB
138entry, in the format specified by
139.IR passwd (5),
34dda72c 140as an argument.
b7eb8299
KB
141This argument must be a colon (``:'') separated list of all the
142user database fields, although they may be empty.
34dda72c
KB
143.TP
144.I -s
145The
146.I -s
147option attempts to change the user's shell to
148.IR newsh .
0568f98e
KB
149.PP
150Once the information has been verified,
151.I chpass
152uses
153.IR mkpasswd (8)
154to update the user database. This is run in the background, and,
155at very large sites could take several minutes. Until this update
156is completed, the password file is unavailable for other updates
157and the new information will not be available to programs.
158.SH FILES
159.DT
160/etc/master.passwd The user database
161/etc/shells The list of approved shells
162.RE
163.SH "SEE ALSO"
164login(1), finger(1), getusershell(3), passwd(5), mkpasswd(8), vipw(8)
165.br
166Robert Morris and Ken Thompson,
167.I UNIX password security
74086f3a
KB
168.SH BUGS
169User information should (and eventually will) be stored elsewhere.