Annotation of src/usr.bin/chpass/chpass.1, Revision 1.40
1.40 ! bentley 1: .\" $OpenBSD: chpass.1,v 1.39 2014/02/16 19:20:26 schwarze Exp $
1.2 deraadt 2: .\" $NetBSD: chpass.1,v 1.7 1996/05/15 21:50:40 jtc Exp $
1.1 deraadt 3: .\"
4: .\" Copyright (c) 1988, 1990, 1993
5: .\" The Regents of the University of California. All rights reserved.
6: .\"
7: .\" Redistribution and use in source and binary forms, with or without
8: .\" modification, are permitted provided that the following conditions
9: .\" are met:
10: .\" 1. Redistributions of source code must retain the above copyright
11: .\" notice, this list of conditions and the following disclaimer.
12: .\" 2. Redistributions in binary form must reproduce the above copyright
13: .\" notice, this list of conditions and the following disclaimer in the
14: .\" documentation and/or other materials provided with the distribution.
1.28 millert 15: .\" 3. Neither the name of the University nor the names of its contributors
1.1 deraadt 16: .\" may be used to endorse or promote products derived from this software
17: .\" without specific prior written permission.
18: .\"
19: .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20: .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21: .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22: .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23: .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24: .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25: .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26: .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27: .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28: .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29: .\" SUCH DAMAGE.
30: .\"
31: .\" @(#)chpass.1 8.2 (Berkeley) 12/30/93
32: .\"
1.40 ! bentley 33: .Dd $Mdocdate: February 16 2014 $
1.1 deraadt 34: .Dt CHPASS 1
35: .Os
36: .Sh NAME
1.16 aaron 37: .Nm chpass ,
38: .Nm chfn ,
39: .Nm chsh
1.1 deraadt 40: .Nd add or change user database information
41: .Sh SYNOPSIS
42: .Nm chpass
1.13 niklas 43: .Op Fl ly
1.1 deraadt 44: .Op Fl s Ar newshell
1.9 aaron 45: .Op Ar user
1.33 jmc 46: .Nm chpass
47: .Op Fl l
48: .Fl a Ar list
1.1 deraadt 49: .Sh DESCRIPTION
1.16 aaron 50: .Nm chpass
1.1 deraadt 51: allows editing of the user database information associated
52: with
1.9 aaron 53: .Ar user ,
1.1 deraadt 54: or, by default, the current user.
55: The information is formatted and supplied to an editor for changes.
56: .Pp
57: Only the information that the user is allowed to change is displayed.
58: .Pp
1.24 millert 59: If YP is enabled change requests are first tried in the local database,
1.13 niklas 60: and then in the YP database, if there was no entry to change locally.
1.16 aaron 61: .Pp
62: .Nm chfn
63: and
64: .Nm chsh
65: are synonyms for
66: .Nm chpass .
1.13 niklas 67: .Pp
1.1 deraadt 68: The options are as follows:
69: .Bl -tag -width Ds
1.6 deraadt 70: .It Fl a Ar list
1.18 aaron 71: The superuser is allowed to directly supply a user database
1.1 deraadt 72: entry, in the format specified by
73: .Xr passwd 5 ,
74: as an argument.
1.9 aaron 75: This argument must be a colon
76: .Pq Sq \&:
77: separated list of all the
1.1 deraadt 78: user database fields, although they may be empty.
1.19 aaron 79: This operation is not supported in YP environments; only local additions
80: can be performed which requires the
1.13 niklas 81: .Fl l
1.19 aaron 82: flag to be specified.
1.13 niklas 83: .It Fl l
84: In environments where YP is enabled, always alter local information as
85: opposed to information in YP.
1.6 deraadt 86: .It Fl s Ar newshell
1.9 aaron 87: Attempts to change the user's shell to
1.1 deraadt 88: .Ar newshell .
1.13 niklas 89: .It Fl y
90: In environments where YP is enabled, always change the YP entry, even if this
91: is a modification request and there is a local entry for the specified user.
1.1 deraadt 92: .El
93: .Pp
94: Possible display items are as follows:
95: .Pp
1.14 aaron 96: .Bl -tag -width "Office Location:" -compact -offset indent
1.1 deraadt 97: .It Login:
98: user's login name
99: .It Password:
100: user's encrypted password
101: .It Uid:
102: user's login
103: .It Gid:
104: user's login group
105: .It Change:
106: password change time
107: .It Expire:
108: account expiration time
109: .It Class:
110: user's general classification
111: .It Home Directory:
112: user's home directory
113: .It Shell:
114: user's login shell
115: .It Full Name:
116: user's real name
1.14 aaron 117: .It Office Location:
118: user's office location
119: .It Office Phone:
120: user's office phone
1.1 deraadt 121: .It Home Phone:
122: user's home phone
123: .El
124: .Pp
125: The
126: .Ar login
127: field is the user name used to access the computer account.
128: .Pp
129: The
130: .Ar password
131: field contains the encrypted form of the user's password.
132: .Pp
133: The
134: .Ar uid
135: field is the number associated with the
136: .Ar login
137: field.
138: Both of these fields should be unique across the system (and often
139: across a group of systems) as they control file access.
140: .Pp
141: While it is possible to have multiple entries with identical login names
1.17 aaron 142: and/or identical user IDs, it is usually a mistake to do so.
143: Routines that manipulate these files will often return only one of the multiple
1.1 deraadt 144: entries, and that one by random selection.
145: .Pp
146: The
147: .Ar group
148: field is the group that the user will be placed in at login.
1.38 jmc 149: Since
150: .Bx
151: supports multiple groups (see
1.25 mpech 152: .Xr groups 1 ) ,
1.1 deraadt 153: this field currently has little special meaning.
154: This field may be filled in with either a number or a group name (see
155: .Xr group 5 ) .
156: .Pp
157: The
158: .Ar change
159: field is the date by which the password must be changed.
160: .Pp
161: The
162: .Ar expire
163: field is the date on which the account expires.
164: .Pp
165: Both the
166: .Ar change
167: and
168: .Ar expire
1.40 ! bentley 169: fields should be entered in the form
! 170: .Ar month day year
! 171: where
1.1 deraadt 172: .Ar month
173: is the month name (the first three characters are sufficient),
174: .Ar day
175: is the day of the month, and
176: .Ar year
177: is the year.
178: .Pp
179: The
180: .Ar class
1.24 millert 181: field specifies a key in the
182: .Xr login.conf 5
183: database of login class attributes.
184: If empty, the
185: .Dq default
1.29 jmc 186: record is used.
1.1 deraadt 187: .Pp
188: The user's
189: .Ar home directory
1.35 sobrado 190: is the full
191: .Ux
192: path name where the user will be placed at login.
1.1 deraadt 193: .Pp
194: The
195: .Ar shell
196: field is the command interpreter the user prefers.
197: If the
198: .Ar shell
1.9 aaron 199: field is empty, the Bourne shell
200: .Pq Pa /bin/sh
1.1 deraadt 201: is assumed.
1.18 aaron 202: When altering a login shell, and not the superuser, the user
1.1 deraadt 203: may not change from a non-standard shell or to a non-standard
204: shell.
205: Non-standard is defined as a shell not found in
206: .Pa /etc/shells .
207: .Pp
208: The last four fields are for storing the user's
209: .Ar full name , office location ,
210: and
1.8 deraadt 211: .Ar work
1.1 deraadt 212: and
1.8 deraadt 213: .Ar home telephone
1.1 deraadt 214: numbers.
215: .Pp
216: Once the information has been verified,
1.12 aaron 217: .Nm
1.1 deraadt 218: uses
219: .Xr pwd_mkdb 8
220: to update the user database.
1.29 jmc 221: .Sh ENVIRONMENT
222: The
223: .Xr vi 1
224: editor will be used unless the environment variable
225: .Ev EDITOR
226: is set to
227: an alternate editor.
228: When the editor terminates, the information is re-read and used to
229: update the user database itself.
230: Only the user, or the superuser, may edit the information associated
231: with the user.
232: .Sh FILES
1.30 avsm 233: .Bl -tag -width /var/tmp/pw.XXXXXXXXXX -compact
1.29 jmc 234: .It Pa /etc/master.passwd
235: user database
236: .It Pa /etc/passwd
1.36 jmc 237: user database, with confidential information removed
1.29 jmc 238: .It Pa /etc/ptmp
239: lock file for the passwd database
240: .It Pa /etc/shells
241: list of approved shells
1.31 avsm 242: .It Pa /var/tmp/pw.XXXXXXXXXX
1.29 jmc 243: temporary copy of the user passwd information
244: .El
1.20 aaron 245: .Sh DIAGNOSTICS
246: .Bl -diag
1.37 schwarze 247: .It "Attempting to lock password file, please wait or press ^C to abort"
1.26 millert 248: .Pp
249: The password file is currently locked by another process;
250: .Nm
251: will keep trying to lock the password file until it succeeds or
1.32 jmc 252: the user hits the interrupt character (control-C by default).
1.26 millert 253: If
254: .Nm
255: is interrupted while trying to gain the lock any changes made will be lost.
256: .Pp
257: If the process holding the lock was prematurely terminated the lock
258: file may be stale and
259: .Nm
260: will wait forever trying to lock the password file.
261: To determine whether a live process is actually holding the lock, the
1.23 millert 262: admin may run the following:
263: .Bd -literal -offset indent
1.27 mpech 264: $ fstat /etc/ptmp
1.23 millert 265: .Ed
266: .Pp
267: If no process is listed, it is safe to remove the
1.20 aaron 268: .Pa /etc/ptmp
1.26 millert 269: file to clear the error.
1.1 deraadt 270: .El
271: .Sh SEE ALSO
1.10 alex 272: .Xr finger 1 ,
1.1 deraadt 273: .Xr login 1 ,
274: .Xr passwd 1 ,
275: .Xr getusershell 3 ,
1.24 millert 276: .Xr login.conf 5 ,
1.1 deraadt 277: .Xr passwd 5 ,
278: .Xr pwd_mkdb 8 ,
279: .Xr vipw 8
280: .Rs
1.22 deraadt 281: .%A Robert Morris
282: .%A Ken Thompson
1.39 schwarze 283: .%T Password security: a case history
284: .%J Communications of the ACM
285: .%V Volume 22
286: .%N Issue 11
287: .%D Nov. 1979
288: .%P 594\(en597
1.1 deraadt 289: .Re
290: .Sh HISTORY
291: The
292: .Nm
1.11 aaron 293: command appeared in
1.1 deraadt 294: .Bx 4.3 Reno .