xref: /freebsd/usr.sbin/pw/pw.8 (revision 3a7e707703f3f441fe85fc72911f11e56b6c5bf9)
1db34a710SJoerg Wunsch.\" Copyright (C) 1996
2db34a710SJoerg Wunsch.\" David L. Nugent.  All rights reserved.
3d6f907dcSJoerg Wunsch.\"
49fd0dafcSJoerg Wunsch.\" Redistribution and use in source and binary forms, with or without
59fd0dafcSJoerg Wunsch.\" modification, are permitted provided that the following conditions
69fd0dafcSJoerg Wunsch.\" are met:
79fd0dafcSJoerg Wunsch.\" 1. Redistributions of source code must retain the above copyright
89fd0dafcSJoerg Wunsch.\"    notice, this list of conditions and the following disclaimer.
99fd0dafcSJoerg Wunsch.\" 2. Redistributions in binary form must reproduce the above copyright
109fd0dafcSJoerg Wunsch.\"    notice, this list of conditions and the following disclaimer in the
119fd0dafcSJoerg Wunsch.\"    documentation and/or other materials provided with the distribution.
12d6f907dcSJoerg Wunsch.\"
13db34a710SJoerg Wunsch.\" THIS SOFTWARE IS PROVIDED BY DAVID L. NUGENT AND CONTRIBUTORS ``AS IS'' AND
149fd0dafcSJoerg Wunsch.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
159fd0dafcSJoerg Wunsch.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16db34a710SJoerg Wunsch.\" ARE DISCLAIMED.  IN NO EVENT SHALL DAVID L. NUGENT OR CONTRIBUTORS BE LIABLE
179fd0dafcSJoerg Wunsch.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
189fd0dafcSJoerg Wunsch.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
199fd0dafcSJoerg Wunsch.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
209fd0dafcSJoerg Wunsch.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
219fd0dafcSJoerg Wunsch.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
229fd0dafcSJoerg Wunsch.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
239fd0dafcSJoerg Wunsch.\" SUCH DAMAGE.
249fd0dafcSJoerg Wunsch.\"
253a7e7077SDaniel O'Callaghan.\"	$Id: pw.8,v 1.9 1997/02/22 16:12:25 peter Exp $
269fd0dafcSJoerg Wunsch.\"
279fd0dafcSJoerg Wunsch.Dd December 9, 1996
28d6f907dcSJoerg Wunsch.Dt PW 8
29d6f907dcSJoerg Wunsch.Os
30d6f907dcSJoerg Wunsch.Sh NAME
31d6f907dcSJoerg Wunsch.Nm pw
329fd0dafcSJoerg Wunsch.Nd create, remove, modify & display system users and groups
33d6f907dcSJoerg Wunsch.Sh SYNOPSIS
34d6f907dcSJoerg Wunsch.Nm pw
35d6f907dcSJoerg Wunsch.Ar useradd
36d6f907dcSJoerg Wunsch.Op name|uid
37d6f907dcSJoerg Wunsch.Op Fl C Ar config
38d6f907dcSJoerg Wunsch.Op Fl q
39d6f907dcSJoerg Wunsch.Op Fl n Ar name
40d6f907dcSJoerg Wunsch.Op Fl u Ar uid
41d6f907dcSJoerg Wunsch.Op Fl c Ar comment
42d6f907dcSJoerg Wunsch.Op Fl d Ar dir
43d6f907dcSJoerg Wunsch.Op Fl e Ar date
44d6f907dcSJoerg Wunsch.Op Fl p Ar date
45d6f907dcSJoerg Wunsch.Op Fl g Ar group
46d6f907dcSJoerg Wunsch.Op Fl G Ar grouplist
47d6f907dcSJoerg Wunsch.Op Fl m
48d6f907dcSJoerg Wunsch.Op Fl k Ar dir
49d6f907dcSJoerg Wunsch.Op Fl s Ar shell
50d6f907dcSJoerg Wunsch.Op Fl o
51d6f907dcSJoerg Wunsch.Op Fl L Ar class
52d6f907dcSJoerg Wunsch.Op Fl h Ar fd
539fd0dafcSJoerg Wunsch.Op Fl N
549fd0dafcSJoerg Wunsch.Op Fl P
55f1d684faSDavid Nugent.Op Fl Y
56d6f907dcSJoerg Wunsch.Nm pw
57d6f907dcSJoerg Wunsch.Ar useradd
58d6f907dcSJoerg Wunsch.Op name|uid
59f1d684faSDavid Nugent.Fl D
60d6f907dcSJoerg Wunsch.Op Fl C Ar config
61d6f907dcSJoerg Wunsch.Op Fl q
62d6f907dcSJoerg Wunsch.Op Fl b Ar dir
63d6f907dcSJoerg Wunsch.Op Fl e Ar days
64d6f907dcSJoerg Wunsch.Op Fl p Ar days
65d6f907dcSJoerg Wunsch.Op Fl g Ar group
66d6f907dcSJoerg Wunsch.Op Fl G Ar grouplist
67d6f907dcSJoerg Wunsch.Op Fl k Ar dir
68d6f907dcSJoerg Wunsch.Op Fl u Ar min,max
69d6f907dcSJoerg Wunsch.Op Fl i Ar min,max
70d6f907dcSJoerg Wunsch.Op Fl w Ar method
71d6f907dcSJoerg Wunsch.Op Fl s Ar shell
72f1d684faSDavid Nugent.Op Fl y Ar path
73d6f907dcSJoerg Wunsch.Nm pw
74d6f907dcSJoerg Wunsch.Ar userdel
75d6f907dcSJoerg Wunsch.Op name|uid
76d6f907dcSJoerg Wunsch.Op Fl n Ar name
77d6f907dcSJoerg Wunsch.Op Fl u Ar uid
78d6f907dcSJoerg Wunsch.Op Fl r
79f1d684faSDavid Nugent.Op Fl Y
80d6f907dcSJoerg Wunsch.Nm pw
81d6f907dcSJoerg Wunsch.Ar usermod
82d6f907dcSJoerg Wunsch.Op name|uid
83d6f907dcSJoerg Wunsch.Op Fl C Ar config
84d6f907dcSJoerg Wunsch.Op Fl q
85d6f907dcSJoerg Wunsch.Op Fl n Ar name
86d6f907dcSJoerg Wunsch.Op Fl u Ar uid
87d6f907dcSJoerg Wunsch.Op Fl c Ar comment
88d6f907dcSJoerg Wunsch.Op Fl d Ar dir
89d6f907dcSJoerg Wunsch.Op Fl e Ar date
90d6f907dcSJoerg Wunsch.Op Fl p Ar date
91d6f907dcSJoerg Wunsch.Op Fl g Ar group
92d6f907dcSJoerg Wunsch.Op Fl G Ar grouplist
93d6f907dcSJoerg Wunsch.Op Fl l Ar name
94d6f907dcSJoerg Wunsch.Op Fl m
95d6f907dcSJoerg Wunsch.Op Fl k Ar dir
969fd0dafcSJoerg Wunsch.Op Fl w Ar method
97d6f907dcSJoerg Wunsch.Op Fl s Ar shell
98d6f907dcSJoerg Wunsch.Op Fl L Ar class
99d6f907dcSJoerg Wunsch.Op Fl h Ar fd
1009fd0dafcSJoerg Wunsch.Op Fl N
1019fd0dafcSJoerg Wunsch.Op Fl P
102f1d684faSDavid Nugent.Op Fl Y
103d6f907dcSJoerg Wunsch.Nm pw
104d6f907dcSJoerg Wunsch.Ar usershow
105d6f907dcSJoerg Wunsch.Op name|uid
106d6f907dcSJoerg Wunsch.Op Fl n Ar name
107d6f907dcSJoerg Wunsch.Op Fl u Ar uid
108d6f907dcSJoerg Wunsch.Op Fl F
1099fd0dafcSJoerg Wunsch.Op Fl P
110d6f907dcSJoerg Wunsch.Op Fl a
111d6f907dcSJoerg Wunsch.Nm pw
1129fd0dafcSJoerg Wunsch.Ar usernext
1139fd0dafcSJoerg Wunsch.Op Fl C Ar config
1149fd0dafcSJoerg Wunsch.Op Fl q
1159fd0dafcSJoerg Wunsch.Nm pw
116d6f907dcSJoerg Wunsch.Ar groupadd
117d6f907dcSJoerg Wunsch.Op group|gid
118d6f907dcSJoerg Wunsch.Op Fl C Ar config
119d6f907dcSJoerg Wunsch.Op Fl q
120d6f907dcSJoerg Wunsch.Op Fl n Ar group
121d6f907dcSJoerg Wunsch.Op Fl g Ar gid
1229fd0dafcSJoerg Wunsch.Op Fl M Ar members
123d6f907dcSJoerg Wunsch.Op Fl o
124d6f907dcSJoerg Wunsch.Op Fl h Ar fd
1259fd0dafcSJoerg Wunsch.Op Fl N
1269fd0dafcSJoerg Wunsch.Op Fl P
127f1d684faSDavid Nugent.Op Fl Y
128d6f907dcSJoerg Wunsch.Nm pw
129d6f907dcSJoerg Wunsch.Ar groupdel
130d6f907dcSJoerg Wunsch.Op Fl n Ar name
131d6f907dcSJoerg Wunsch.Op Fl g Ar gid
132f1d684faSDavid Nugent.Op Fl Y
133d6f907dcSJoerg Wunsch.Nm pw
134d6f907dcSJoerg Wunsch.Ar groupmod
135d6f907dcSJoerg Wunsch.Op Fl C Ar config
136d6f907dcSJoerg Wunsch.Op Fl q
137d6f907dcSJoerg Wunsch.Op Fl F
138d6f907dcSJoerg Wunsch.Op Fl n Ar name
139d6f907dcSJoerg Wunsch.Op Fl g Ar gid
140d6f907dcSJoerg Wunsch.Op Fl l Ar name
1419fd0dafcSJoerg Wunsch.Op Fl M Ar members
1429fd0dafcSJoerg Wunsch.Op Fl m Ar newmembers
143d6f907dcSJoerg Wunsch.Op Fl h Ar fd
1449fd0dafcSJoerg Wunsch.Op Fl N
1459fd0dafcSJoerg Wunsch.Op Fl P
146f1d684faSDavid Nugent.Op Fl Y
147d6f907dcSJoerg Wunsch.Nm pw
148d6f907dcSJoerg Wunsch.Ar groupshow
149d6f907dcSJoerg Wunsch.Op Fl n Ar name
150d6f907dcSJoerg Wunsch.Op Fl g Ar gid
151d6f907dcSJoerg Wunsch.Op Fl F
1529fd0dafcSJoerg Wunsch.Op Fl P
153d6f907dcSJoerg Wunsch.Op Fl a
1549fd0dafcSJoerg Wunsch.Nm pw
1559fd0dafcSJoerg Wunsch.Ar groupnext
1569fd0dafcSJoerg Wunsch.Op Fl C Ar config
1579fd0dafcSJoerg Wunsch.Op Fl q
158d6f907dcSJoerg Wunsch.Sh DESCRIPTION
159d6f907dcSJoerg Wunsch.Nm pw
160d6f907dcSJoerg Wunschis a command-line based editor for the system
161d6f907dcSJoerg Wunsch.Em user
162d6f907dcSJoerg Wunschand
163d6f907dcSJoerg Wunsch.Em group
1643a7e7077SDaniel O'Callaghanfiles, allowing the superuser an easy to use and standardized way of adding,
165d6f907dcSJoerg Wunschmodifying and removing users and groups.
166d6f907dcSJoerg WunschNote that
167d6f907dcSJoerg Wunsch.Nm pw
168d6f907dcSJoerg Wunschonly operates on the local user and group files; NIS users and groups must be
169d6f907dcSJoerg Wunschmaintained on the NIS server.
170d6f907dcSJoerg Wunsch.Nm pw
171053375e8SMike Pritchardhandles updating the
172053375e8SMike Pritchard.Pa passwd ,
173053375e8SMike Pritchard.Pa master.passwd ,
174053375e8SMike Pritchard.Pa group
175053375e8SMike Pritchardand the secure and insecure
176d6f907dcSJoerg Wunschpassword database files, and must be run as root.
177d6f907dcSJoerg Wunsch.Pp
178d6f907dcSJoerg WunschThe first one or two keywords provided on
179d6f907dcSJoerg Wunsch.Xr pw 8 's
180d6f907dcSJoerg Wunschcommand line provide the context for the remainder of the arguments.
181d6f907dcSJoerg WunschOne of the keywords
182d6f907dcSJoerg Wunsch.Ar user
183d6f907dcSJoerg Wunschand
184d6f907dcSJoerg Wunsch.Ar group
185d6f907dcSJoerg Wunschmay be combined or provided separately with
186d6f907dcSJoerg Wunsch.Ar add ,
187d6f907dcSJoerg Wunsch.Ar del ,
1889fd0dafcSJoerg Wunsch.Ar mod ,
189d6f907dcSJoerg Wunsch.Ar show ,
1909fd0dafcSJoerg Wunschor
1919fd0dafcSJoerg Wunsch.Ar next ,
192d6f907dcSJoerg Wunschand may be specified in either order (ie. showuser, usershow, show user and user show
193d6f907dcSJoerg Wunschare all considered to be the same thing).
194053375e8SMike PritchardThis flexibility is useful for interactive scripts which call
195d6f907dcSJoerg Wunsch.Nm pw
196d6f907dcSJoerg Wunschfor the actual user and group database manipulation.
197d6f907dcSJoerg WunschFollowing these keywords, you may optionally specify the user or group name or numeric
198d6f907dcSJoerg Wunschid as an alternative to using the
199d6f907dcSJoerg Wunsch.Fl n Ar name ,
200d6f907dcSJoerg Wunsch.Fl u Ar uid ,
201d6f907dcSJoerg Wunsch.Fl g Ar gid
2029fd0dafcSJoerg Wunschoptions.
203d6f907dcSJoerg Wunsch.Pp
204f1d684faSDavid NugentThe following flags are common to all or most modes of operation:
205d6f907dcSJoerg Wunsch.Pp
2069fd0dafcSJoerg Wunsch.Bl -tag -width "-G grouplist"
207d6f907dcSJoerg Wunsch.It Fl C Ar config
208d6f907dcSJoerg WunschBy default,
209d6f907dcSJoerg Wunsch.Nm pw
210d6f907dcSJoerg Wunschreads the file
211d6f907dcSJoerg Wunsch.Pa /etc/pw.conf
212d6f907dcSJoerg Wunschto obtain policy information on how new user accounts and groups are to be created,
213d6f907dcSJoerg Wunschand the
2149fd0dafcSJoerg Wunsch.Fl C
2159fd0dafcSJoerg Wunschoption specifies a different configuration file.
216d6f907dcSJoerg WunschMost of the contents in the configuration file may be overridden via command line
217d6f907dcSJoerg Wunschoptions, but it may be more useful to set up standard information for addition of
2189fd0dafcSJoerg Wunschnew accounts in the configuration file.
219d6f907dcSJoerg Wunsch.It Fl q
220d6f907dcSJoerg WunschUse of this option causes
221d6f907dcSJoerg Wunsch.Nm pw
222d6f907dcSJoerg Wunschto suppress error messages, which may be useful in interactive environments where it
223d6f907dcSJoerg Wunschis preferable to interpret status codes returned by
224d6f907dcSJoerg Wunsch.Nm pw
225d6f907dcSJoerg Wunschrather than messing up a carefully formatted display.
2269fd0dafcSJoerg Wunsch.It Fl N
2279fd0dafcSJoerg WunschThis option is available in add and modify operations, and causes
2289fd0dafcSJoerg Wunsch.Nm pw
2299fd0dafcSJoerg Wunschto skip updating the user/group databases and instead print the result
2309fd0dafcSJoerg Wunschof the operation without actually performing it.
2319fd0dafcSJoerg WunschYou may use the
2329fd0dafcSJoerg Wunsch.Fl P
2339fd0dafcSJoerg Wunschoption to switch between standard passwd and readable formats.
234f1d684faSDavid Nugent.It Fl Y
235f1d684faSDavid NugentUsing this option with any of the update modes causes
236f1d684faSDavid Nugent.Nm pw
237f1d684faSDavid Nugentto run
238f1d684faSDavid Nugent.Xr make 1
239f1d684faSDavid Nugentafter changing to the directory
240f1d684faSDavid Nugent.Pa /var/yp .
241f1d684faSDavid NugentThis is intended to allow automatic updating of the NIS database files.
242f1d684faSDavid NugentIf separate passwd and group files are being used by NIS, then use the
243f1d684faSDavid Nugent.Fl y Ar path
244f1d684faSDavid Nugentoption to specify the location of the NIS passwd database so that pw
245f1d684faSDavid Nugentwill automatically update it concurrently with the system password
246f1d684faSDavid Nugentdatabases.
247d6f907dcSJoerg Wunsch.El
248d6f907dcSJoerg Wunsch.Pp
249d6f907dcSJoerg Wunsch.Sh USER OPTIONS
250d6f907dcSJoerg WunschThe following options apply to the
251d6f907dcSJoerg Wunsch.Ar useradd ,
252d6f907dcSJoerg Wunschand
253d6f907dcSJoerg Wunsch.Ar usermod ,
254d6f907dcSJoerg Wunschcommands:
255d6f907dcSJoerg Wunsch.Pp
2569fd0dafcSJoerg Wunsch.Bl -tag -width "-G grouplist"
257d6f907dcSJoerg Wunsch.It Fl n Ar name
258d6f907dcSJoerg WunschSpecifies the user/account name.
259d6f907dcSJoerg Wunsch.It Fl u Ar uid
260d6f907dcSJoerg WunschSpecifies the user/account numeric id.
261d6f907dcSJoerg Wunsch.Pp
262d6f907dcSJoerg WunschUsually, you need only to provide one or the other of these options, as the account
263053375e8SMike Pritchardname will imply the uid, and vice versa.
264d6f907dcSJoerg WunschAlso, you may provide either the account or userid immediately after the
265d6f907dcSJoerg Wunsch.Ar useradd ,
266d6f907dcSJoerg Wunsch.Ar userdel ,
267d6f907dcSJoerg Wunsch.Ar usermod
268d6f907dcSJoerg Wunschor
269d6f907dcSJoerg Wunsch.Ar usershow
270d6f907dcSJoerg Wunschkeyword on the command line without the need to use
271d6f907dcSJoerg Wunsch.Ql Fl n
272d6f907dcSJoerg Wunschor
273d6f907dcSJoerg Wunsch.Ql Fl u .
274d6f907dcSJoerg WunschThere are times, however, were you need to provide both.
275d6f907dcSJoerg WunschFor example, when changing the uid of an existing user with
276d6f907dcSJoerg Wunsch.Ar usermod ,
277d6f907dcSJoerg Wunschor overriding the default uid when creating a new account.
278d6f907dcSJoerg WunschIf you wish
279d6f907dcSJoerg Wunsch.Nm pw
280d6f907dcSJoerg Wunschto automatically allocate the uid to a new user on
281d6f907dcSJoerg Wunsch.Ar useradd ,
282d6f907dcSJoerg Wunschthen you should
283d6f907dcSJoerg Wunsch.Em not
284d6f907dcSJoerg Wunschuse the
285d6f907dcSJoerg Wunsch.Ql Fl u
2869fd0dafcSJoerg Wunschoption.
287d6f907dcSJoerg Wunsch.El
288d6f907dcSJoerg Wunsch.Pp
289d6f907dcSJoerg WunschOptions available with both
290d6f907dcSJoerg Wunsch.Ar useradd
291d6f907dcSJoerg Wunschand
292d6f907dcSJoerg Wunsch.Ar usermod
293d6f907dcSJoerg Wunschare:
294d6f907dcSJoerg Wunsch.Bl -tag -width "-G grouplist"
295d6f907dcSJoerg Wunsch.It Fl c Ar comment
296d6f907dcSJoerg WunschThis field sets the contents of the passwd GECOS field, which normally contains up
297d6f907dcSJoerg Wunschto four comma-separated fields containing the user's full name, office or location,
298d6f907dcSJoerg Wunschwork and home phone numbers.
299d6f907dcSJoerg WunschThese sub-fields are used by convention only, however, and are optional.
300d6f907dcSJoerg WunschIf this field is to contain spaces, you need to quote the comment itself with double
301d6f907dcSJoerg Wunschquotes
302d6f907dcSJoerg Wunsch.Ql \&" .
303d6f907dcSJoerg WunschAvoid using commas in this field as these are used as sub-field separators, and the
304d6f907dcSJoerg Wunschcolon
305d6f907dcSJoerg Wunsch.Ql \&:
306d6f907dcSJoerg Wunschcharacter also cannot be used as this is the field separator in the passwd file.
307d6f907dcSJoerg Wunsch.It Fl d Ar dir
308d6f907dcSJoerg WunschThis option sets the account's home directory.
309d6f907dcSJoerg WunschNormally, you will only use this if the home directory is to be different from the
310d6f907dcSJoerg Wunschdefault (which is determined from pw.conf, which specifies the base home directory
311d6f907dcSJoerg Wunsch- normally /home - with the account name as a subdirectory).
312d6f907dcSJoerg Wunsch.It Fl e Ar date
313d6f907dcSJoerg WunschSets the account's expiration date.
314d6f907dcSJoerg WunschFormat of the date is either a UNIX time in decimal, or a date in
315d6f907dcSJoerg Wunsch.Ql \& dd-mmm-yy[yy]
316d6f907dcSJoerg Wunschformat, where dd is the day, mmm is the month, either in numeric or alphabetic format
317d6f907dcSJoerg Wunsch('Jan', 'Feb' etc) and year is either a two or four digit year.
318d6f907dcSJoerg WunschThis option also accepts a relative date in the form
319d6f907dcSJoerg Wunsch.Ql \&+n[mhdwoy]
320d6f907dcSJoerg Wunschwhere
321d6f907dcSJoerg Wunsch.Ql \&n
322d6f907dcSJoerg Wunschis a decimal, octal (leading 0) or hexadecimal (leading 0x) digit followed by the
323053375e8SMike Pritchardnumber of Minutes, Hours, Days, Weeks, Months or Years from the current date at
324d6f907dcSJoerg Wunschwhich the expiry date is to be set.
325d6f907dcSJoerg Wunsch.It Fl p Ar date
326d6f907dcSJoerg WunschSets the account's password expiration date.
327d6f907dcSJoerg WunschThis field is identical to the account expiration date option, except that it
328d6f907dcSJoerg Wunschapplies to forced password changes.
329053375e8SMike PritchardThe same formats are accepted as with the account expiration option.
330d6f907dcSJoerg Wunsch.It Fl g Ar group
331d6f907dcSJoerg WunschSets the account's primary group to the given group.
332d6f907dcSJoerg Wunsch.Ar group
333d6f907dcSJoerg Wunschmay be either the group name or its corresponding group id number.
334d6f907dcSJoerg Wunsch.It Fl G Ar grouplist
335d6f907dcSJoerg WunschSets the additional groups to which an account belongs.
336d6f907dcSJoerg Wunsch.Ar grouplist
337d6f907dcSJoerg Wunschis a comma-separated list or group names or group ids.
338d6f907dcSJoerg WunschWhen adding a user, the user's name is added to the group lists in
339d6f907dcSJoerg Wunsch.Pa /etc/group ,
340d6f907dcSJoerg Wunschand when editing a user, the user's name is also added to the group lists, and
341d6f907dcSJoerg Wunschremoved from any groups not specified in
342d6f907dcSJoerg Wunsch.Ar grouplist .
343d6f907dcSJoerg WunschNote: a user should not be added to their primary group in
344d6f907dcSJoerg Wunsch.Pa /etc/group .
345d6f907dcSJoerg WunschAlso, group membership changes do not take effect immediately for current logins,
346d6f907dcSJoerg Wunschonly logins subsequent to the change.
3479fd0dafcSJoerg Wunsch.It Fl L Ar class
3489fd0dafcSJoerg WunschThis option sets the login class for the user being created.
3499fd0dafcSJoerg WunschSee
3509fd0dafcSJoerg Wunsch.Xr login.conf 5
3519fd0dafcSJoerg Wunschfor more information on user classes.
352d6f907dcSJoerg Wunsch.It Fl m
353d6f907dcSJoerg WunschThis option instructs
354d6f907dcSJoerg Wunsch.Nm pw
355d6f907dcSJoerg Wunschto attempt to create the user's home directory.
356d6f907dcSJoerg WunschWhile primarily useful when adding a new account with
357d6f907dcSJoerg Wunsch.Ar useradd ,
358d6f907dcSJoerg Wunschthis may also be of use when moving an existing user's home directory elsewhere on
359d6f907dcSJoerg Wunschthe filesystem.
360d6f907dcSJoerg WunschThe new home directory is populated with the contents of the
361d6f907dcSJoerg Wunsch.Ar skeleton
362d6f907dcSJoerg Wunschdirectory, which typically contains a set of shell configuration files that the
363053375e8SMike Pritcharduser may personalize to taste.
364d6f907dcSJoerg WunschWhen
365d6f907dcSJoerg Wunsch.Ql Fl m
366d6f907dcSJoerg Wunschis used on an account with
367d6f907dcSJoerg Wunsch.Ar usermod ,
368d6f907dcSJoerg Wunschany existing configuration files in the user's home directory are
369d6f907dcSJoerg Wunsch.Em not
370d6f907dcSJoerg Wunschoverwritten with the prototype files.
371d6f907dcSJoerg Wunsch.Pp
372d6f907dcSJoerg WunschWhen a user's home directory is created, it will be default be as a subdirectory of the
373d6f907dcSJoerg Wunsch.Ar basehome
374d6f907dcSJoerg Wunschdirectory specified with the
375d6f907dcSJoerg Wunsch.Ql Fl b Ar dir
376d6f907dcSJoerg Wunschoption (see below), and will be named the same as the account.
377d6f907dcSJoerg WunschThis may be overridden with the
378d6f907dcSJoerg Wunsch.Ql Fl d Ar dir
379d6f907dcSJoerg Wunschoption on the command line, if desired.
380d6f907dcSJoerg Wunsch.It Fl k Ar dir
381d6f907dcSJoerg WunschSets the
382d6f907dcSJoerg Wunsch.Ar skeleton
383d6f907dcSJoerg Wunschsubdirectory, from which the basic startup and configuration files are copied when
384d6f907dcSJoerg Wunschthe user's home directory is created.
385d6f907dcSJoerg WunschThis option only has meaning when used with
386d6f907dcSJoerg Wunsch.Ql Fl D
387d6f907dcSJoerg Wunsch(see below) or
388d6f907dcSJoerg Wunsch.Ql Fl m .
389d6f907dcSJoerg Wunsch.It Fl s Ar shell
390d6f907dcSJoerg WunschSets or changes the user's login shell to
391d6f907dcSJoerg Wunsch.Ar shell .
392d6f907dcSJoerg WunschIf the path to the shell program is omitted,
393d6f907dcSJoerg Wunsch.Nm pw
394d6f907dcSJoerg Wunschsearches the
395d6f907dcSJoerg Wunsch.Ar shellpath
396d6f907dcSJoerg Wunschspecified in
397d6f907dcSJoerg Wunsch.Pa /etc/pw.conf
398d6f907dcSJoerg Wunschand fills it in as appropriate.
399d6f907dcSJoerg WunschNote that unless you have a specific reason to do so, you should avoid
400d6f907dcSJoerg Wunschspecifying the path - this will allow
401d6f907dcSJoerg Wunsch.Nm pw
402d6f907dcSJoerg Wunschto validate that the program exists and is executable.
403d6f907dcSJoerg WunschSpecifying a full path (or supplying a blank "" shell) avoids this check
404d6f907dcSJoerg Wunschand allows for such entries as
405d6f907dcSJoerg Wunsch.Ql \& /nonexistent
406d6f907dcSJoerg Wunschthat should be set for accounts not intended for interactive login.
407d6f907dcSJoerg Wunsch.It Fl L Ar class
408d6f907dcSJoerg WunschSets the
409d6f907dcSJoerg Wunsch.Em class
410d6f907dcSJoerg Wunschfield in the user's passwd record.
411d6f907dcSJoerg WunschThis field is not currently used, but will be in the future used to specify a
412d6f907dcSJoerg Wunsch.Em termcap
413d6f907dcSJoerg Wunschentry like tag (see
414d6f907dcSJoerg Wunsch.Xr passwd 5
415d6f907dcSJoerg Wunschfor details).
416d6f907dcSJoerg Wunsch.It Fl h Ar fd
417d6f907dcSJoerg WunschThis option provides a special interface by which interactive scripts can
418d6f907dcSJoerg Wunschset an account password using
419d6f907dcSJoerg Wunsch.Nm pw .
420d6f907dcSJoerg WunschBecause the command line and environment are fundamental insecure mechanisms
421d6f907dcSJoerg Wunschby which programs can accept information,
422d6f907dcSJoerg Wunsch.Nm pw
423d6f907dcSJoerg Wunschwill only allow setting of account and group passwords via a file descriptor
424d6f907dcSJoerg Wunsch(usually a pipe between an interactive script and the program).
425d6f907dcSJoerg Wunsch.Ar sh ,
426d6f907dcSJoerg Wunsch.Ar bash ,
427d6f907dcSJoerg Wunsch.Ar ksh
428d6f907dcSJoerg Wunschand
429d6f907dcSJoerg Wunsch.Ar perl
430d6f907dcSJoerg Wunschall posses mechanisms by which this can be done.
431d6f907dcSJoerg WunschAlternatively,
432d6f907dcSJoerg Wunsch.Nm pw
433d6f907dcSJoerg Wunschwill prompt for the user's password if
434d6f907dcSJoerg Wunsch.Ql Fl h Ar 0
435d6f907dcSJoerg Wunschis given, nominating
436d6f907dcSJoerg Wunsch.Em stdin
437d6f907dcSJoerg Wunschas the file descriptor on which to read the password.
438d6f907dcSJoerg WunschNote that this password will be read once and once only and is intended
439d6f907dcSJoerg Wunschfor use by a script or similar rather than interactive use.
440d6f907dcSJoerg WunschIf you wish to have new password confirmation along the lines of
441d6f907dcSJoerg Wunsch.Xr passwd 1 ,
442d6f907dcSJoerg Wunschthis must be implemented as part of the interactive script that calls
443d6f907dcSJoerg Wunsch.Nm pw .
444d6f907dcSJoerg Wunsch.Pp
445d6f907dcSJoerg WunschIf a value of
446d6f907dcSJoerg Wunsch.Ql \&-
447d6f907dcSJoerg Wunschis given as the argument
448d6f907dcSJoerg Wunsch.Ar fd ,
449d6f907dcSJoerg Wunschthen the password will be set to
450d6f907dcSJoerg Wunsch.Ql \&* ,
451d6f907dcSJoerg Wunschrendering the account inaccessible via passworded login.
452d6f907dcSJoerg Wunsch.El
453d6f907dcSJoerg Wunsch.Pp
454d6f907dcSJoerg WunschIt is possible to use
455d6f907dcSJoerg Wunsch.Ar useradd
456d6f907dcSJoerg Wunschto create a new account that duplicates an existing user id.
457d6f907dcSJoerg WunschWhile this is normally considered an error and will be rejected, the
458d6f907dcSJoerg Wunsch.Ql Fl o
4599fd0dafcSJoerg Wunschoption overrides the check for duplicates and allows the duplication of
4609fd0dafcSJoerg Wunschthe user id.
4619fd0dafcSJoerg WunschThis may be useful if you allow the same user to login under
4629fd0dafcSJoerg Wunschdifferent contexts (different group allocations, different home
4639fd0dafcSJoerg Wunschdirectory, different shell) while providing basically the same
4649fd0dafcSJoerg Wunschpermissions for access to the user's files in each account.
465d6f907dcSJoerg Wunsch.Pp
466d6f907dcSJoerg WunschThe
467d6f907dcSJoerg Wunsch.Ar useradd
468d6f907dcSJoerg Wunschcommand also has the ability to set new user and group defaults by using the
469d6f907dcSJoerg Wunsch.Ql Fl D
4709fd0dafcSJoerg Wunschoption.
471d6f907dcSJoerg WunschInstead of adding a new user,
472d6f907dcSJoerg Wunsch.Nm pw
473d6f907dcSJoerg Wunschwrites a new set of defaults to its configuration file,
474d6f907dcSJoerg Wunsch.Pa /etc/pw.conf .
475d6f907dcSJoerg WunschWhen using the
476d6f907dcSJoerg Wunsch.Ql Fl D
4779fd0dafcSJoerg Wunschoption, you must not use either
478d6f907dcSJoerg Wunsch.Ql Fl n Ar name
479d6f907dcSJoerg Wunschor
480d6f907dcSJoerg Wunsch.Ql Fl u Ar uid
481d6f907dcSJoerg Wunschor an error will result.
482d6f907dcSJoerg WunschUse of
483d6f907dcSJoerg Wunsch.Ql Fl D
4849fd0dafcSJoerg Wunschchanges the meaning of several command line switches in the
485d6f907dcSJoerg Wunsch.Ar useradd
486d6f907dcSJoerg Wunschcommand.
487d6f907dcSJoerg WunschThese are:
488d6f907dcSJoerg Wunsch.Bl -tag -width "-G grouplist"
489d6f907dcSJoerg Wunsch.It Fl D
490d6f907dcSJoerg WunschSet default values in
491d6f907dcSJoerg Wunsch.Pa /etc/pw.conf
492d6f907dcSJoerg Wunschconfiguration file, or a different named configuration file if the
493d6f907dcSJoerg Wunsch.Ql Fl C Ar config
4949fd0dafcSJoerg Wunschoption is used.
495d6f907dcSJoerg Wunsch.It Fl b Ar dir
496d6f907dcSJoerg WunschSets the root directory in which user home directories are created.
497d6f907dcSJoerg WunschThe default value for this is
498d6f907dcSJoerg Wunsch.Ql \&/home ,
499d6f907dcSJoerg Wunschbut it may be set elsewhere as desired.
500d6f907dcSJoerg Wunsch.It Fl e Ar days
501d6f907dcSJoerg WunschSets the default account expiration period in days.
502d6f907dcSJoerg WunschUnlike use without
503d6f907dcSJoerg Wunsch.Ql Fl D ,
504d6f907dcSJoerg Wunschthe argument must be numeric, which specifies the number of days after creation when
505d6f907dcSJoerg Wunschthe account is to expire.
506d6f907dcSJoerg WunschA value of 0 suppresses automatic calculation of the expiry date.
507d6f907dcSJoerg Wunsch.It Fl p Ar days
508d6f907dcSJoerg WunschSets the default password expiration period in days.
509d6f907dcSJoerg Wunsch.It Fl g Ar group
510d6f907dcSJoerg WunschSets the default group for new users.
511d6f907dcSJoerg WunschIf a blank group is specified using
512d6f907dcSJoerg Wunsch.Ql Fl g Ar \&"" ,
513d6f907dcSJoerg Wunschthen new users will be allocated their own private primary group (a new group created
514d6f907dcSJoerg Wunschwith the same name as their login name).
515d6f907dcSJoerg WunschIf a group is supplied, either its name or uid may be given as an argument.
516d6f907dcSJoerg Wunsch.It Fl G Ar grouplist
517d6f907dcSJoerg WunschSets the default groups in which new users are made members.
518d6f907dcSJoerg WunschThis is a separate set of groups from the primary group, and you should avoid
519d6f907dcSJoerg Wunschnominating the same group as both the primary and in extra groups.
520d6f907dcSJoerg WunschIn other words, these extra groups determine membership in groups
521d6f907dcSJoerg Wunsch.Em other than
522d6f907dcSJoerg Wunschthe primary group.
523d6f907dcSJoerg Wunsch.Ar grouplist
524d6f907dcSJoerg Wunschis a comma-separated list of group names or ids, or a mixture of both, and are always
525d6f907dcSJoerg Wunschstored in
526d6f907dcSJoerg Wunsch.Pa /etc/pw.conf
527d6f907dcSJoerg Wunschby their symbolic names.
5289fd0dafcSJoerg Wunsch.It Fl L Ar class
5299fd0dafcSJoerg WunschThis option sets the default login class for new users.
530d6f907dcSJoerg Wunsch.It Fl k Ar dir
531d6f907dcSJoerg WunschSets the default
532d6f907dcSJoerg Wunsch.Em skeleton
533053375e8SMike Pritcharddirectory, from which prototype shell and other initialization files are copied when
534d6f907dcSJoerg Wunsch.Nm pw
535d6f907dcSJoerg Wunschcreates a user's home directory.
5369fd0dafcSJoerg Wunsch.It Fl u Ar min,max , Fl i Ar min,max
5379fd0dafcSJoerg WunschThese options set the minimum and maximum user and group ids allocated for new accounts
538d6f907dcSJoerg Wunschand groups created by
539d6f907dcSJoerg Wunsch.Nm pw .
540d6f907dcSJoerg WunschThe default values for each is 1000 minimum and 32000 maximum.
541d6f907dcSJoerg Wunsch.Ar min
542d6f907dcSJoerg Wunschand
543d6f907dcSJoerg Wunsch.Ar max
544d6f907dcSJoerg Wunschare both numbers, where max must be greater than min, and both must be between 0
545d6f907dcSJoerg Wunschand 32767.
546d6f907dcSJoerg WunschIn general, user and group ids less than 100 are reserved for use by the system,
547d6f907dcSJoerg Wunschand numbers greater than 32000 may also be reserved for special purposes (used by
548d6f907dcSJoerg Wunschsome system daemons).
549d6f907dcSJoerg Wunsch.It Fl w Ar method
550d6f907dcSJoerg WunschThe
551d6f907dcSJoerg Wunsch.Ql Fl w
5529fd0dafcSJoerg Wunschoption sets the default method used to set passwords for newly created user accounts.
553d6f907dcSJoerg Wunsch.Ar method
554d6f907dcSJoerg Wunschis one of:
555d6f907dcSJoerg Wunsch.Pp
556d6f907dcSJoerg Wunsch.Bl -tag -width random -offset indent -compact
557d6f907dcSJoerg Wunsch.It no
558d6f907dcSJoerg Wunschdisables login on newly created accounts
559d6f907dcSJoerg Wunsch.It yes
560d6f907dcSJoerg Wunschforces the password to be the account name
561d6f907dcSJoerg Wunsch.It none
562d6f907dcSJoerg Wunschforces a blank password
563d6f907dcSJoerg Wunsch.It random
564d6f907dcSJoerg WunschGenerates a random password
565d6f907dcSJoerg Wunsch.El
566d6f907dcSJoerg Wunsch.Pp
567d6f907dcSJoerg WunschThe
568d6f907dcSJoerg Wunsch.Ql \&random
569d6f907dcSJoerg Wunschor
570d6f907dcSJoerg Wunsch.Ql \&no
571d6f907dcSJoerg Wunschmethods are the most secure; in the former case,
572d6f907dcSJoerg Wunsch.Nm pw
573d6f907dcSJoerg Wunschgenerates a password and prints it to stdout, which is suitable where you issue
574d6f907dcSJoerg Wunschusers with passwords to access their accounts rather than having the user nominate
575d6f907dcSJoerg Wunschtheir own (possibly poorly chosen) password.
576d6f907dcSJoerg WunschThe
577d6f907dcSJoerg Wunsch.Ql \&no
578d6f907dcSJoerg Wunschmethod requires that the superuser use
579d6f907dcSJoerg Wunsch.Xr passwd 1
580d6f907dcSJoerg Wunschto render the account accessible with a password.
581f1d684faSDavid Nugent.It Fl y Ar path
582f1d684faSDavid NugentThis sets the pathname of the database used by NIS if you are not sharing
583f1d684faSDavid Nugentthe information from
584f1d684faSDavid Nugent.Pa /etc/master.passwd
585f1d684faSDavid Nugentdirectly with NIS.
586f1d684faSDavid NugentYou should only set this option on NIS servers.
587d6f907dcSJoerg Wunsch.El
588d6f907dcSJoerg Wunsch.Pp
589d6f907dcSJoerg WunschThe
590d6f907dcSJoerg Wunsch.Ar userdel
5919fd0dafcSJoerg Wunschcommand has only three valid options. The
592d6f907dcSJoerg Wunsch.Ql Fl n Ar name
593d6f907dcSJoerg Wunschand
594d6f907dcSJoerg Wunsch.Ql Fl u Ar uid
5959fd0dafcSJoerg Wunschoptions have already been covered above.
5969fd0dafcSJoerg WunschThe additional option is:
5979fd0dafcSJoerg Wunsch.Bl -tag -width "-G grouplist"
598d6f907dcSJoerg Wunsch.It Fl r
599d6f907dcSJoerg WunschThis tells
600d6f907dcSJoerg Wunsch.Nm pw
601d6f907dcSJoerg Wunschto remove the user's home directory and all of its contents.
602d6f907dcSJoerg Wunsch.Nm pw
603d6f907dcSJoerg Wunscherrs on the side of caution when removing files from the system.
604d6f907dcSJoerg WunschFirstly, it will not do so if the uid of the account being removed is also used by
605d6f907dcSJoerg Wunschanother account on the system, and the 'home' directory in the password file is
606d6f907dcSJoerg Wunscha valid path that commences with the character
607d6f907dcSJoerg Wunsch.Ql \&/ .
608d6f907dcSJoerg WunschSecondly, it will only remove files and directories that are actually owned by
609d6f907dcSJoerg Wunschthe user, or symbolic links owned by anyone under the user's home directory.
610d6f907dcSJoerg WunschFinally, after deleting all contents owned by the user only empty directories
611d6f907dcSJoerg Wunschwill be removed.
612053375e8SMike PritchardIf any additional cleanup work is required, this is left to the administrator.
613d6f907dcSJoerg Wunsch.El
614d6f907dcSJoerg Wunsch.Pp
615d6f907dcSJoerg WunschMail spool files and crontabs are always removed when an account is deleted as these
616d6f907dcSJoerg Wunschare unconditionally attached to the user name.
617d6f907dcSJoerg WunschJobs queued for processing by
618d6f907dcSJoerg Wunsch.Ar at
619d6f907dcSJoerg Wunschare also removed if the user's uid is unique (not also used by another account on the
620d6f907dcSJoerg Wunschsystem).
621d6f907dcSJoerg Wunsch.Pp
622d6f907dcSJoerg WunschThe
623d6f907dcSJoerg Wunsch.Ar usershow
624d6f907dcSJoerg Wunschcommand allows viewing of an account in one of two formats.
625d6f907dcSJoerg WunschBy default, the format is identical to the format used in
626d6f907dcSJoerg Wunsch.Pa /etc/master.passwd
627d6f907dcSJoerg Wunschwith the password field replaced with a
628d6f907dcSJoerg Wunsch.Ql \&* .
629d6f907dcSJoerg WunschIf the
6309fd0dafcSJoerg Wunsch.Ql Fl P
6319fd0dafcSJoerg Wunschoption is used, then
632d6f907dcSJoerg Wunsch.Nm pw
633d6f907dcSJoerg Wunschoutputs the account details in a more human readable form.
634d6f907dcSJoerg WunschThe
635d6f907dcSJoerg Wunsch.Ql Fl a
6369fd0dafcSJoerg Wunschoption lists all users currently on file.
6379fd0dafcSJoerg Wunsch.Pp
6389fd0dafcSJoerg WunschThe command
6399fd0dafcSJoerg Wunsch.Ar usernext
6409fd0dafcSJoerg Wunschreturns the next available user and group ids separated by a colon.
6419fd0dafcSJoerg WunschThis is normally of interest only to interactive scripts or front-ends
6429fd0dafcSJoerg Wunschthat use
6439fd0dafcSJoerg Wunsch.Nm pw .
644d6f907dcSJoerg Wunsch.Pp
645d6f907dcSJoerg Wunsch.Sh GROUP OPTIONS
646d6f907dcSJoerg WunschThe
647d6f907dcSJoerg Wunsch.Ql Fl C Ar config
648d6f907dcSJoerg Wunschand
649d6f907dcSJoerg Wunsch.Ql Fl q
6509fd0dafcSJoerg Wunschoptions (explained at the start of the previous section) are available
6519fd0dafcSJoerg Wunschwith the group manipulation commands.
652d6f907dcSJoerg WunschOther common options to all group-related commands are:
6539fd0dafcSJoerg Wunsch.Bl -tag -width "-m newmembers"
654d6f907dcSJoerg Wunsch.It Fl n Ar name
655d6f907dcSJoerg WunschSpecifies the group name.
656d6f907dcSJoerg Wunsch.It Fl g Ar gid
657d6f907dcSJoerg WunschSpecifies the group numeric id.
658d6f907dcSJoerg Wunsch.Pp
6599fd0dafcSJoerg WunschAs with the account name and id fields, you will usually only need
6609fd0dafcSJoerg Wunschto supply one of these, as the group name implies the uid and vice
6619fd0dafcSJoerg Wunschversa.
6629fd0dafcSJoerg WunschYou will only need to use both when setting a specific group id
6639fd0dafcSJoerg Wunschagainst a new group or when changing the uid of an existing group.
6649fd0dafcSJoerg Wunsch.It Fl M Ar memberlist
6659fd0dafcSJoerg WunschThis option provides an alternative way to add existing users to a
6669fd0dafcSJoerg Wunschnew group (in groupadd) or replace an existing membership list (in
6679fd0dafcSJoerg Wunschgroupmod).
6689fd0dafcSJoerg Wunsch.Ar memberlist
6699fd0dafcSJoerg Wunschis a comma separated list of valid and existing user names or uids.
6709fd0dafcSJoerg Wunsch.It Fl m Ar newmembers
6719fd0dafcSJoerg WunschSimilar to
6729fd0dafcSJoerg Wunsch.Op M ,
6739fd0dafcSJoerg Wunschthis option allows the
6749fd0dafcSJoerg Wunsch.Em addition
6759fd0dafcSJoerg Wunschof existing users to a group without first replacing the existing list of
6769fd0dafcSJoerg Wunschmembers.
6779fd0dafcSJoerg WunschLogin names or user ids may be used, and duplicated users are automatically
6789fd0dafcSJoerg Wunschand silently eliminated.
679d6f907dcSJoerg Wunsch.El
680d6f907dcSJoerg Wunsch.Pp
681d6f907dcSJoerg Wunsch.Ar groupadd
682d6f907dcSJoerg Wunschalso has a
683d6f907dcSJoerg Wunsch.Ql Fl o
684d6f907dcSJoerg Wunschoption that allows allocation of an existing group id to new group.
685d6f907dcSJoerg WunschThe default action is to reject an attempt to add a group, and this option overrides
686d6f907dcSJoerg Wunschthe check for duplicate group ids.
687d6f907dcSJoerg WunschThere is rarely any need to duplicate a group id.
688d6f907dcSJoerg Wunsch.Pp
689d6f907dcSJoerg WunschThe
690d6f907dcSJoerg Wunsch.Ar groupmod
6919fd0dafcSJoerg Wunschcommand adds one additonal option:
692d6f907dcSJoerg Wunsch.Pp
6939fd0dafcSJoerg Wunsch.Bl -tag -width "-m newmembers"
694d6f907dcSJoerg Wunsch.It Fl l Ar name
695d6f907dcSJoerg WunschThis option allows changing of an existing group name to
696d6f907dcSJoerg Wunsch.Ql \&name .
697d6f907dcSJoerg WunschThe new name must not already exist, and any attempt to duplicate an existing group
698d6f907dcSJoerg Wunschname will be rejected.
699d6f907dcSJoerg Wunsch.El
700d6f907dcSJoerg Wunsch.Pp
701d6f907dcSJoerg WunschOptions for
702d6f907dcSJoerg Wunsch.Ar groupshow
703d6f907dcSJoerg Wunschare the same as for
704d6f907dcSJoerg Wunsch.Ar usershow ,
705d6f907dcSJoerg Wunschwith the
706d6f907dcSJoerg Wunsch.Ql Fl g Ar gid
707d6f907dcSJoerg Wunschreplacing
708d6f907dcSJoerg Wunsch.Ql Fl u Ar uid
709d6f907dcSJoerg Wunschto specify the group id.
710d6f907dcSJoerg Wunsch.Pp
7119fd0dafcSJoerg WunschThe command
7129fd0dafcSJoerg Wunsch.Ar groupnext
7139fd0dafcSJoerg Wunschreturns the next available group id on standard output.
7149fd0dafcSJoerg Wunsch.Sh DIAGNOSTICS
7159fd0dafcSJoerg Wunsch.Nm pw
7169fd0dafcSJoerg Wunschreturns EXIT_SUCCESS on successful operation, otherwise one of the
7179fd0dafcSJoerg Wunschfollowing exit codes defined by
7189fd0dafcSJoerg Wunsch.Xr sysexits 3
7199fd0dafcSJoerg Wunschas follows:
7209fd0dafcSJoerg Wunsch.Bl -tag -width xxxx
7219fd0dafcSJoerg Wunsch.It EX_USAGE
7229fd0dafcSJoerg Wunsch.Bl -bullet -compact
7239fd0dafcSJoerg Wunsch.It
7249fd0dafcSJoerg WunschCommand line syntax errors (invalid keyword, unknown option)
7259fd0dafcSJoerg Wunsch.El
7269fd0dafcSJoerg Wunsch.It EX_NOPERM
7279fd0dafcSJoerg Wunsch.Bl -bullet -compact
7289fd0dafcSJoerg Wunsch.It
7299fd0dafcSJoerg WunschAttempting to run one of the update modes as non-root.
7309fd0dafcSJoerg Wunsch.El
7319fd0dafcSJoerg Wunsch.It EX_OSERR
7329fd0dafcSJoerg Wunsch.Bl -bullet -compact
7339fd0dafcSJoerg Wunsch.It
7349fd0dafcSJoerg WunschMemory allocation error.
7359fd0dafcSJoerg Wunsch.It
7369fd0dafcSJoerg WunschRead error from password file descriptor.
7379fd0dafcSJoerg Wunsch.El
7389fd0dafcSJoerg Wunsch.It EX_DATAERR
7399fd0dafcSJoerg Wunsch.Bl -bullet -compact
7409fd0dafcSJoerg Wunsch.It
7419fd0dafcSJoerg WunschBad or invalid data provided or missing on the command line or
7429fd0dafcSJoerg Wunschvia the password flie descriptor.
7439fd0dafcSJoerg Wunsch.It
7449fd0dafcSJoerg WunschAttempted to remove, rename root account or change its uid.
7459fd0dafcSJoerg Wunsch.El
7469fd0dafcSJoerg Wunsch.It EX_OSFILE
7479fd0dafcSJoerg Wunsch.Bl -bullet -compact
7489fd0dafcSJoerg Wunsch.It
7499fd0dafcSJoerg WunschSkeleton directory is invalid or does not exist.
7509fd0dafcSJoerg Wunsch.It
7519fd0dafcSJoerg WunschBase home directory is invalid or does not exist.
7529fd0dafcSJoerg Wunsch.It
7539fd0dafcSJoerg WunschInvalid or non-existant shell specified.
7549fd0dafcSJoerg Wunsch.El
7559fd0dafcSJoerg Wunsch.It EX_NOUSER
7569fd0dafcSJoerg Wunsch.Bl -bullet -compact
7579fd0dafcSJoerg Wunsch.It
7589fd0dafcSJoerg WunschUser, user id, group or group id specified does not exist.
7599fd0dafcSJoerg Wunsch.It
7609fd0dafcSJoerg WunschUser or group recorded added or modified unexpectedly disappeared.
7619fd0dafcSJoerg Wunsch.El
7629fd0dafcSJoerg Wunsch.It EX_SOFTWARE
7639fd0dafcSJoerg Wunsch.Bl -bullet -compact
7649fd0dafcSJoerg Wunsch.It
7659fd0dafcSJoerg WunschNo more group or user ids available within specified range.
7669fd0dafcSJoerg Wunsch.El
7679fd0dafcSJoerg Wunsch.It EX_IOERR
7689fd0dafcSJoerg Wunsch.Bl -bullet -compact
7699fd0dafcSJoerg Wunsch.It
7709fd0dafcSJoerg WunschUnable to rewrite configuration file.
7719fd0dafcSJoerg Wunsch.It
7729fd0dafcSJoerg WunschError updating group or user database files.
7739fd0dafcSJoerg Wunsch.It
7749fd0dafcSJoerg WunschUpdate error for passwd or group database files.
7759fd0dafcSJoerg Wunsch.El
7769fd0dafcSJoerg Wunsch.It EX_CONFIG
7779fd0dafcSJoerg Wunsch.Bl -bullet -compact
7789fd0dafcSJoerg Wunsch.It
7799fd0dafcSJoerg WunschNo base home directory configured.
7809fd0dafcSJoerg Wunsch.El
7819fd0dafcSJoerg Wunsch.El
7829fd0dafcSJoerg Wunsch.Pp
783d6f907dcSJoerg Wunsch.Sh NOTES
784d6f907dcSJoerg WunschFor a summary of options available with each command, you can use
785d6f907dcSJoerg Wunsch.Dl pw [command] help
786d6f907dcSJoerg WunschFor example,
787d6f907dcSJoerg Wunsch.Dl pw useradd help
788d6f907dcSJoerg Wunschlists all available options for the useradd operation.
789d9b711b7SDavid Nugent.Pp
790d9b711b7SDavid Nugent.Nm pw
791d9b711b7SDavid Nugentallows 8-bit characters in the passwd gecos field (user's full name,
792d9b711b7SDavid Nugentoffice, work and home phone number subfields), but disallows them in
793d9b711b7SDavid Nugentuser login and group names.
794d9b711b7SDavid NugentUse 8-bit characters with caution, as connection to the internet will
795d9b711b7SDavid Nugentrequire that your mail transport program supports 8BITMIME, and will
796d9b711b7SDavid Nugentconvert headers containing 8-bit characters to 7-bit quoted-printable
797d9b711b7SDavid Nugentformat.
798d9b711b7SDavid Nugent.Xr sendmail 8
799d9b711b7SDavid Nugentdoes support this.
800d9b711b7SDavid NugentUse of 8-bit characters in the gecos field should be used in
801d9b711b7SDavid Nugentconjunction with the user's default locale and character set
802d9b711b7SDavid Nugentand should not be implemented without their use.
803d9b711b7SDavid NugentUsing 8-bit characters may also affect other
804d9b711b7SDavid Nugentprograms that transmit the contents of the gecos field over the
805d9b711b7SDavid Nugentinternet, such as
806d9b711b7SDavid Nugent.Xr fingerd 8 ,
807d9b711b7SDavid Nugentand a small number of tcpip clients, such as irc, where fullnames
808d9b711b7SDavid Nugentspecified in the passwd file may be used by default.
809d6f907dcSJoerg Wunsch.Sh FILES
810d6f907dcSJoerg Wunsch.Bl -tag -width /etc/master.passwd.new -compact
811d6f907dcSJoerg Wunsch.It Pa /etc/master.passwd
812d6f907dcSJoerg WunschThe user database
813d6f907dcSJoerg Wunsch.It Pa /etc/passwd
814d6f907dcSJoerg WunschA Version 7 format password file
8159fd0dafcSJoerg Wunsch.It Pa /etc/login.conf
8169fd0dafcSJoerg WunschThe user capabilities database
817d6f907dcSJoerg Wunsch.It Pa /etc/group
818d6f907dcSJoerg WunschThe group database
819d6f907dcSJoerg Wunsch.It Pa /etc/master.passwd.new
820d6f907dcSJoerg WunschTemporary copy of the master password file
821d6f907dcSJoerg Wunsch.It Pa /etc/passwd.new
822d6f907dcSJoerg WunschTemporary copy of the Version 7 password file
823d6f907dcSJoerg Wunsch.It Pa /etc/group.new
824d6f907dcSJoerg WunschTemporary copy of the group file
825d6f907dcSJoerg Wunsch.It Pa /etc/pw.conf
826d6f907dcSJoerg WunschPw default options file
827d6f907dcSJoerg Wunsch.El
828d6f907dcSJoerg Wunsch.Sh SEE ALSO
829d6f907dcSJoerg Wunsch.Xr chpass 1 ,
830053375e8SMike Pritchard.Xr passwd 1 ,
831d6f907dcSJoerg Wunsch.Xr group 5 ,
832bfd34a4aSWolfram Schneider.Xr login.conf 5 ,
833053375e8SMike Pritchard.Xr passwd 5 ,
834053375e8SMike Pritchard.Xr pw.conf 5 ,
835d6f907dcSJoerg Wunsch.Xr pwd_mkdb 8 ,
836053375e8SMike Pritchard.Xr vipw 8
837d6f907dcSJoerg Wunsch.Sh HISTORY
838d6f907dcSJoerg Wunsch.Nm pw
8399fd0dafcSJoerg Wunschwas written to mimic many of the options used in the SYSV
840d6f907dcSJoerg Wunsch.Em shadow
8419fd0dafcSJoerg Wunschsupport suite, but is modified for passwd and group fields specific to
842053375e8SMike Pritchardthe
843053375e8SMike Pritchard.Bx 4.4
8449fd0dafcSJoerg Wunschoperating system, and combines all of the major elements
8459fd0dafcSJoerg Wunschinto a single command.
846