]> git.saurik.com Git - apple/system_cmds.git/blame - chpass.tproj/chpass.1
system_cmds-279.tar.gz
[apple/system_cmds.git] / chpass.tproj / chpass.1
CommitLineData
1815bff5
A
1.\" Copyright (c) 1988, 1990, 1993
2.\" The Regents of the University of California. 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 8.2 (Berkeley) 12/30/93
20e66415 33.\" $FreeBSD: src/usr.bin/chpass/chpass.1,v 1.34 2002/12/24 13:41:47 ru Exp $
1815bff5
A
34.\"
35.Dd December 30, 1993
36.Dt CHPASS 1
37.Os
38.Sh NAME
20e66415
A
39.Nm chpass ,
40.Nm chfn ,
41.Nm chsh ,
1815bff5
A
42.Nd add or change user database information
43.Sh SYNOPSIS
20e66415
A
44.Nm
45.Op Fl a Ar list
46.Op Fl p Ar encpass
47.Op Fl e Ar expiretime
48.Op Fl s Ar newshell
49.Op user
1815bff5 50.Sh DESCRIPTION
20e66415
A
51The
52.Nm
53utility
1815bff5
A
54allows editing of the user database information associated
55with
56.Ar user
57or, by default, the current user.
20e66415
A
58.Pp
59The
60.Nm chfn ,
61and
62.Nm chsh
63utilities behave identically to
64.Nm .
65(There is only one program.)
66.Pp
1815bff5
A
67The information is formatted and supplied to an editor for changes.
68.Pp
69Only the information that the user is allowed to change is displayed.
70.Pp
71The options are as follows:
20e66415 72.Bl -tag -width indent
1815bff5
A
73.It Fl a
74The super-user is allowed to directly supply a user database
75entry, in the format specified by
76.Xr passwd 5 ,
77as an argument.
20e66415
A
78This argument must be a colon
79.Pq Dq \&:
80separated list of all the
1815bff5 81user database fields, although they may be empty.
c3a08f59
A
82[Note that this only changes the user database,
83.Li master.passwd Ns .]
20e66415
A
84.It Fl p
85The super-user is allowed to directly supply an encrypted password field,
86in the format used by
87.Xr crypt 3 ,
88as an argument.
c3a08f59
A
89[See the discussion in
90.Xr getpwent 3
91about types of passwords; this option may not be appropriate.]
20e66415
A
92.It Fl e Ar expiretime
93Change the account expire time.
94This option is used to set the expire time
95from a script as if it was done in the interactive editor.
96.It Fl s Ar newshell
97Attempt to change the user's shell to
1815bff5
A
98.Ar newshell .
99.El
100.Pp
101Possible display items are as follows:
102.Pp
20e66415 103.Bl -tag -width "Other Information:" -compact -offset indent
1815bff5
A
104.It Login:
105user's login name
106.It Password:
107user's encrypted password
c3a08f59
A
108[do
109.Em not
110use this to change a password; use
111.Xr passwd 1
112instead]
1815bff5
A
113.It Uid:
114user's login
115.It Gid:
116user's login group
20e66415
A
117.It Class:
118user's general classification
1815bff5
A
119.It Change:
120password change time
121.It Expire:
122account expiration time
20e66415 123.It Full Name:
c3a08f59
A
124user's real name (*)
125.\"user's real name
126.\".It Office Location:
127.\"user's office location (1)
128.\".It Office Phone:
129.\"user's office phone (1)
130.\".It Home Phone:
131.\"user's home phone (1)
132.\".It Other Information:
133.\"any locally defined parameters for user (1)
1815bff5
A
134.It Home Directory:
135user's home directory
136.It Shell:
137user's login shell
20e66415 138.Pp
c3a08f59
A
139.It NOTE(*) -
140.\"In the actual master.passwd file, these fields are comma-delimited
141.\"fields embedded in the FullName field.
142Historically, the so-call
143.Qq GECOS
144field in the user database entry contain the full name plus other information.
145Only the full name is currently supported.
1815bff5
A
146.El
147.Pp
148The
149.Ar login
150field is the user name used to access the computer account.
151.Pp
152The
153.Ar password
154field contains the encrypted form of the user's password.
c3a08f59
A
155Do
156.Em not
157use this to change a password; use
158.Xr passwd 1
159instead.
1815bff5
A
160.Pp
161The
162.Ar uid
163field is the number associated with the
164.Ar login
165field.
166Both of these fields should be unique across the system (and often
167across a group of systems) as they control file access.
168.Pp
169While it is possible to have multiple entries with identical login names
170and/or identical user id's, it is usually a mistake to do so. Routines
171that manipulate these files will often return only one of the multiple
172entries, and that one by random selection.
173.Pp
174The
175.Ar group
176field is the group that the user will be placed in at login.
20e66415
A
177Since
178.Bx
179supports multiple groups (see
1815bff5
A
180.Xr groups 1 )
181this field currently has little special meaning.
182This field may be filled in with either a number or a group name (see
183.Xr group 5 ) .
184.Pp
185The
20e66415
A
186.Ar class
187field references class descriptions in
188.Pa /etc/login.conf
189and is typically used to initialize the user's system resource limits
190when they login.
191.Pp
192The
1815bff5
A
193.Ar change
194field is the date by which the password must be changed.
195.Pp
196The
197.Ar expire
198field is the date on which the account expires.
199.Pp
200Both the
201.Ar change
202and
203.Ar expire
20e66415
A
204fields should be entered in the form
205.Dq month day year
206where
1815bff5
A
207.Ar month
208is the month name (the first three characters are sufficient),
209.Ar day
210is the day of the month, and
211.Ar year
212is the year.
213.Pp
c3a08f59
A
214.\"Five fields are available for storing the user's
215.\".Ar full name , office location ,
216.\".Ar work
217.\"and
218.\".Ar home telephone
219.\"numbers and finally
220.\".Ar other information
221.\"which is a single comma delimited string to represent any additional
222.\"gcos fields (typically used for site specific user information).
223.\"Note that
224.\".Xr finger 1
225.\"will display the office location and office phone together under the
226.\"heading
227.\".Ar Office: .
228The
229.Ar full name
230field contains the full name of the user.
1815bff5
A
231.Pp
232The user's
233.Ar home directory
20e66415
A
234is the full
235.Ux
236path name where the user
1815bff5
A
237will be placed at login.
238.Pp
239The
240.Ar shell
241field is the command interpreter the user prefers.
242If the
243.Ar shell
244field is empty, the Bourne shell,
245.Pa /bin/sh ,
246is assumed.
247When altering a login shell, and not the super-user, the user
248may not change from a non-standard shell or to a non-standard
249shell.
250Non-standard is defined as a shell not found in
251.Pa /etc/shells .
252.Pp
1815bff5 253Once the information has been verified,
20e66415 254.Nm
1815bff5
A
255uses
256.Xr pwd_mkdb 8
257to update the user database.
c3a08f59
A
258.Sh LOOKUPD AND DIRECTORY SERVICE AWARENESS
259User database entries (among other things) are under the control of
260.Xr lookupd 8
261and may be physically located in many different places, including local
262and remote
263.Xr netinfo 5
264databases, directory service agents such as LDAP servers and flat file databases
265such as
266.Li master.passwd .
267This version of
268.Nm
269is currently limited to changing user database entries in the flat file
270and local netinfo databases.
1815bff5
A
271.Sh ENVIRONMENT
272The
273.Xr vi 1
20e66415
A
274editor will be used unless the environment variable
275.Ev EDITOR
276is set to
1815bff5
A
277an alternate editor.
278When the editor terminates, the information is re-read and used to
279update the user database itself.
280Only the user, or the super-user, may edit the information associated
281with the user.
20e66415
A
282.Pp
283See
284.Xr pwd_mkdb 8
285for an explanation of the impact of setting the
286.Ev PW_SCAN_BIG_IDS
287environment variable.
1815bff5
A
288.Sh FILES
289.Bl -tag -width /etc/master.passwd -compact
290.It Pa /etc/master.passwd
20e66415 291the user database
1815bff5 292.It Pa /etc/passwd
20e66415 293a Version 7 format password file
1815bff5 294.It Pa /etc/chpass.XXXXXX
20e66415 295temporary copy of the password file
1815bff5 296.It Pa /etc/shells
20e66415 297the list of approved shells
1815bff5
A
298.El
299.Sh SEE ALSO
1815bff5 300.Xr finger 1 ,
20e66415 301.Xr login 1 ,
1815bff5
A
302.Xr passwd 1 ,
303.Xr getusershell 3 ,
20e66415 304.Xr login.conf 5 ,
1815bff5
A
305.Xr passwd 5 ,
306.Xr pwd_mkdb 8 ,
307.Xr vipw 8
308.Rs
309.%A Robert Morris
310and
311.%A Ken Thompson
312.%T "UNIX Password security"
313.Re
314.Sh BUGS
315User information should (and eventually will) be stored elsewhere.
316.Sh HISTORY
317The
318.Nm
20e66415 319utility appeared in
1815bff5 320.Bx 4.3 Reno .