xref: /freebsd/usr.sbin/pw/pw.8 (revision 09e8dea79366f1e5b3a73e8a271b26e4b6bf2e6a)
1.\" Copyright (C) 1996
2.\" David L. Nugent.  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.\"
13.\" THIS SOFTWARE IS PROVIDED BY DAVID L. NUGENT AND CONTRIBUTORS ``AS IS'' AND
14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16.\" ARE DISCLAIMED.  IN NO EVENT SHALL DAVID L. NUGENT OR CONTRIBUTORS BE LIABLE
17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
25.\" $FreeBSD$
26.\"
27.Dd December 9, 1996
28.Dt PW 8
29.Os
30.Sh NAME
31.Nm pw
32.Nd create, remove, modify & display system users and groups
33.Sh SYNOPSIS
34.Nm
35.Op Fl V Ar etcdir
36.Ar useradd
37.Op name|uid
38.Op Fl C Ar config
39.Op Fl q
40.Op Fl n Ar name
41.Op Fl u Ar uid
42.Op Fl c Ar comment
43.Op Fl d Ar dir
44.Op Fl e Ar date
45.Op Fl p Ar date
46.Op Fl g Ar group
47.Op Fl G Ar grouplist
48.Op Fl m
49.Op Fl k Ar dir
50.Op Fl w Ar method
51.Op Fl s Ar shell
52.Op Fl o
53.Op Fl L Ar class
54.Op Fl h Ar fd
55.Op Fl N
56.Op Fl P
57.Op Fl Y
58.Nm
59.Op Fl V Ar etcdir
60.Ar useradd
61.Op name|uid
62.Fl D
63.Op Fl C Ar config
64.Op Fl q
65.Op Fl b Ar dir
66.Op Fl e Ar days
67.Op Fl p Ar days
68.Op Fl g Ar group
69.Op Fl G Ar grouplist
70.Op Fl k Ar dir
71.Op Fl u Ar min , Ns Ar max
72.Op Fl i Ar min , Ns Ar max
73.Op Fl w Ar method
74.Op Fl s Ar shell
75.Op Fl y Ar path
76.Nm
77.Op Fl V Ar etcdir
78.Ar userdel
79.Op name|uid
80.Op Fl n Ar name
81.Op Fl u Ar uid
82.Op Fl r
83.Op Fl Y
84.Nm
85.Op Fl V Ar etcdir
86.Ar usermod
87.Op name|uid
88.Op Fl C Ar config
89.Op Fl q
90.Op Fl n Ar name
91.Op Fl u Ar uid
92.Op Fl c Ar comment
93.Op Fl d Ar dir
94.Op Fl e Ar date
95.Op Fl p Ar date
96.Op Fl g Ar group
97.Op Fl G Ar grouplist
98.Op Fl l Ar name
99.Op Fl m
100.Op Fl k Ar dir
101.Op Fl w Ar method
102.Op Fl s Ar shell
103.Op Fl L Ar class
104.Op Fl h Ar fd
105.Op Fl N
106.Op Fl P
107.Op Fl Y
108.Nm
109.Op Fl V Ar etcdir
110.Ar usershow
111.Op name|uid
112.Op Fl n Ar name
113.Op Fl u Ar uid
114.Op Fl F
115.Op Fl P
116.Op Fl 7
117.Op Fl a
118.Nm
119.Op Fl V Ar etcdir
120.Ar usernext
121.Op Fl C Ar config
122.Op Fl q
123.Nm
124.Op Fl V Ar etcdir
125.Ar groupadd
126.Op group|gid
127.Op Fl C Ar config
128.Op Fl q
129.Op Fl n Ar group
130.Op Fl g Ar gid
131.Op Fl M Ar members
132.Op Fl o
133.Op Fl h Ar fd
134.Op Fl N
135.Op Fl P
136.Op Fl Y
137.Nm
138.Op Fl V Ar etcdir
139.Ar groupdel
140.Op group|gid
141.Op Fl n Ar name
142.Op Fl g Ar gid
143.Op Fl Y
144.Nm
145.Op Fl V Ar etcdir
146.Ar groupmod
147.Op group|gid
148.Op Fl C Ar config
149.Op Fl q
150.Op Fl n Ar name
151.Op Fl g Ar gid
152.Op Fl l Ar name
153.Op Fl M Ar members
154.Op Fl m Ar newmembers
155.Op Fl h Ar fd
156.Op Fl N
157.Op Fl P
158.Op Fl Y
159.Nm
160.Op Fl V Ar etcdir
161.Ar groupshow
162.Op group|gid
163.Op Fl n Ar name
164.Op Fl g Ar gid
165.Op Fl F
166.Op Fl P
167.Op Fl a
168.Nm
169.Op Fl V Ar etcdir
170.Ar groupnext
171.Op Fl C Ar config
172.Op Fl q
173.Nm
174.Op Fl V Ar etcdir
175.Ar lock
176.Op name|uid
177.Op Fl C Ar config
178.Op Fl q
179.Nm
180.Op Fl V Ar etcdir
181.Ar unlock
182.Op name|uid
183.Op Fl C Ar config
184.Op Fl q
185.Sh DESCRIPTION
186.Nm Pw
187is a command-line based editor for the system
188.Ar user
189and
190.Ar group
191files, allowing the superuser an easy to use and standardized way of adding,
192modifying and removing users and groups.
193Note that
194.Nm
195only operates on the local user and group files.  NIS users and groups must be
196maintained on the NIS server.
197.Nm Pw
198handles updating the
199.Pa passwd ,
200.Pa master.passwd ,
201.Pa group
202and the secure and insecure
203password database files, and must be run as root.
204.Pp
205The first one or two keywords provided to
206.Nm
207on the command line provide the context for the remainder of the arguments.
208The keywords
209.Ar user
210and
211.Ar group
212may be combined with
213.Ar add ,
214.Ar del ,
215.Ar mod ,
216.Ar show ,
217or
218.Ar next
219in any order.
220(For example,
221.Ar showuser ,
222.Ar usershow ,
223.Ar show user ,
224and
225.Ar user show
226all mean the same thing.)
227This flexibility is useful for interactive scripts calling
228.Nm
229for user and group database manipulation.
230Following these keywords, you may optionally specify the user or group name or numeric
231id as an alternative to using the
232.Fl n Ar name ,
233.Fl u Ar uid ,
234.Fl g Ar gid
235options.
236.Pp
237The following flags are common to most or all modes of operation;
238.Pp
239.Bl -tag -width "-G grouplist"
240.It Fl V Ar etcdir
241This flag sets an alternate location for the password, group and configuration files,
242and may be used to maintain a user/group database in an alternate location.
243If this switch is specified, the system
244.Pa /etc/pw.conf
245will not be sourced for default configuration data, but the file pw.conf in the
246specified directory will be used instead (or none, if it does not exist).
247The
248.Fl C
249flag may be used to override this behaviour.
250As an exception to the general rule where options must follow the operation
251type, the
252.Fl V
253flag may be used on the command line before the operation keyword.
254.It Fl C Ar config
255By default,
256.Nm
257reads the file
258.Pa /etc/pw.conf
259to obtain policy information on how new user accounts and groups are to be created.
260The
261.Fl C
262option specifies a different configuration file.
263While most of the contents of the configuration file may be overridden via
264command-line options, it may be more convenient to keep standard information in a
265configuration file.
266.It Fl q
267Use of this option causes
268.Nm
269to suppress error messages, which may be useful in interactive environments where it
270is preferable to interpret status codes returned by
271.Nm
272rather than messing up a carefully formatted display.
273.It Fl N
274This option is available in
275.Ar add
276and
277.Ar modify
278operations, and tells
279.Nm
280to output the result of the operation without updating the user or group
281databases.
282You may use the
283.Fl P
284option to switch between standard passwd and readable formats.
285.It Fl Y
286Using this option with any of the update modes causes
287.Nm
288to run
289.Xr make 1
290after changing to the directory
291.Pa /var/yp .
292This is intended to allow automatic updating of NIS database files.
293If separate passwd and group files are being used by NIS, then use the
294.Fl y Ar path
295option to specify the location of the NIS passwd database so that
296.Nm
297will concurrently update it with the system password
298databases.
299.El
300.Sh USER OPTIONS
301The following options apply to the
302.Ar useradd
303and
304.Ar usermod
305commands:
306.Pp
307.Bl -tag -width "-G grouplist"
308.It Fl n Ar name
309Specify the user/account name.
310.It Fl u Ar uid
311Specify the user/account numeric id.
312.Pp
313Usually, you only need to provide one or the other of these options, as the account
314name will imply the uid, or vice versa.
315However, there are times when you need to provide both.
316For example, when changing the uid of an existing user with
317.Ar usermod ,
318or overriding the default uid when creating a new account.
319If you wish
320.Nm
321to automatically allocate the uid to a new user with
322.Ar useradd ,
323then you should
324.Em not
325use the
326.Fl u
327option.
328You may also provide either the account or userid immediately after the
329.Ar useradd ,
330.Ar userdel ,
331.Ar usermod
332or
333.Ar usershow
334keywords on the command line without using the
335.Fl n
336or
337.Fl u
338options.
339.El
340.Pp
341.Bl -tag -width "-G grouplist"
342.It Fl c Ar comment
343This field sets the contents of the passwd GECOS field, which normally contains up
344to four comma-separated fields containing the user's full name, office or location,
345and work and home phone numbers.
346These sub-fields are used by convention only, however, and are optional.
347If this field is to contain spaces, you need to quote the comment itself with double
348quotes
349.Ql \&" .
350Avoid using commas in this field as these are used as sub-field separators, and the
351colon
352.Ql \&:
353character also cannot be used as this is the field separator for the passwd
354file itself.
355.It Fl d Ar dir
356This option sets the account's home directory.
357Normally, you will only use this if the home directory is to be different from the
358default determined from
359.Pa /etc/pw.conf
360- normally
361.Pa /home
362with the account name as a subdirectory.
363.It Fl e Ar date
364Set the account's expiration date.
365Format of the date is either a UNIX time in decimal, or a date in
366.Ql dd-mmm-yy[yy]
367format, where dd is the day, mmm is the month, either in numeric or alphabetic format
368('Jan', 'Feb', etc) and year is either a two or four digit year.
369This option also accepts a relative date in the form
370.Ql \&+n[mhdwoy]
371where
372.Ql \&n
373is a decimal, octal (leading 0) or hexadecimal (leading 0x) digit followed by the
374number of Minutes, Hours, Days, Weeks, Months or Years from the current date at
375which the expiration date is to be set.
376.It Fl p Ar date
377Set the account's password expiration date.
378This field is similar to the account expiration date option, except that it
379applies to forced password changes.
380This is set in the same manner as the
381.Fl e
382option.
383.It Fl g Ar group
384Set the account's primary group to the given group.
385.Ar group
386may be defined by either its name or group number.
387.It Fl G Ar grouplist
388Sets additional group memberships for an account.
389.Ar grouplist
390is a comma-separated list of group names or group numbers.
391The user's name is added to the group lists in
392.Pa /etc/group ,
393and
394removed from any groups not specified in
395.Ar grouplist .
396Note: a user should not be added to their primary group with
397.Ar grouplist .
398Also, group membership changes do not take effect for current user login
399sessions, requiring the user to reconnect to be affected by the changes.
400.It Fl L Ar class
401This option sets the login class for the user being created.
402See
403.Xr login.conf 5
404and
405.Xr passwd 5
406for more information on user login classes.
407.It Fl m
408This option instructs
409.Nm
410to attempt to create the user's home directory.
411While primarily useful when adding a new account with
412.Ar useradd ,
413this may also be of use when moving an existing user's home directory elsewhere on
414the filesystem.
415The new home directory is populated with the contents of the
416.Ar skeleton
417directory, which typically contains a set of shell configuration files that the
418user may personalize to taste.
419When
420.Fl m
421is used on an account with
422.Ar usermod ,
423existing configuration files in the user's home directory are
424.Em not
425overwritten from the skeleton files.
426.Pp
427When a user's home directory is created, it will by default be a subdirectory of the
428.Ar basehome
429directory as specified by the
430.Fl b
431option (see below), bearing the name of the new account.
432This can be overridden by the
433.Fl d
434option on the command line, if desired.
435.It Fl k Ar dir
436Set the
437.Ar skeleton
438directory, from which basic startup and configuration files are copied when
439the user's home directory is created.
440This option only has meaning when used with the
441.Fl d
442or
443.Fl m
444flags.
445.It Fl s Ar shell
446Set or changes the user's login shell to
447.Ar shell .
448If the path to the shell program is omitted,
449.Nm
450searches the
451.Ar shellpath
452specified in
453.Pa /etc/pw.conf
454and fills it in as appropriate.
455Note that unless you have a specific reason to do so, you should avoid
456specifying the path - this will allow
457.Nm
458to validate that the program exists and is executable.
459Specifying a full path (or supplying a blank "" shell) avoids this check
460and allows for such entries as
461.Pa /nonexistent
462that should be set for accounts not intended for interactive login.
463.It Fl h Ar fd
464This option provides a special interface by which interactive scripts can
465set an account password using
466.Nm .
467Because the command line and environment are fundamentally insecure mechanisms
468by which programs can accept information,
469.Nm
470will only allow setting of account and group passwords via a file descriptor
471(usually a pipe between an interactive script and the program).
472.Ar sh ,
473.Ar bash ,
474.Ar ksh
475and
476.Ar perl
477all possess mechanisms by which this can be done.
478Alternatively,
479.Nm
480will prompt for the user's password if
481.Fl h Ar 0
482is given, nominating
483.Em stdin
484as the file descriptor on which to read the password.
485Note that this password will be read only once and is intended
486for use by a script rather than for interactive use.
487If you wish to have new password confirmation along the lines of
488.Xr passwd 1 ,
489this must be implemented as part of an interactive script that calls
490.Nm .
491.Pp
492If a value of
493.Ql \&-
494is given as the argument
495.Ar fd ,
496then the password will be set to
497.Ql \&* ,
498rendering the account inaccessible via password-based login.
499.El
500.Pp
501It is possible to use
502.Ar useradd
503to create a new account that duplicates an existing user id.
504While this is normally considered an error and will be rejected, the
505.Fl o
506option overrides the check for duplicates and allows the duplication of
507the user id.
508This may be useful if you allow the same user to login under
509different contexts (different group allocations, different home
510directory, different shell) while providing basically the same
511permissions for access to the user's files in each account.
512.Pp
513The
514.Ar useradd
515command also has the ability to set new user and group defaults by using the
516.Fl D
517option.
518Instead of adding a new user,
519.Nm
520writes a new set of defaults to its configuration file,
521.Pa /etc/pw.conf .
522When using the
523.Fl D
524option, you must not use either
525.Fl n Ar name
526or
527.Fl u Ar uid
528or an error will result.
529Use of
530.Fl D
531changes the meaning of several command line switches in the
532.Ar useradd
533command.
534These are:
535.Bl -tag -width "-G grouplist"
536.It Fl D
537Set default values in
538.Pa /etc/pw.conf
539configuration file, or a different named configuration file if the
540.Fl C Ar config
541option is used.
542.It Fl b Ar dir
543Set the root directory in which user home directories are created.
544The default value for this is
545.Pa /home ,
546but it may be set elsewhere as desired.
547.It Fl e Ar days
548Set the default account expiration period in days.
549Unlike use without
550.Fl D ,
551the argument must be numeric, which specifies the number of days after creation when
552the account is to expire.
553A value of 0 suppresses automatic calculation of the expiry date.
554.It Fl p Ar days
555Set the default password expiration period in days.
556.It Fl g Ar group
557Set the default group for new users.
558If a blank group is specified using
559.Fl g Ar \&"" ,
560then new users will be allocated their own private primary group
561with the same name as their login name.
562If a group is supplied, either its name or uid may be given as an argument.
563.It Fl G Ar grouplist
564Set the default groups in which new users are granted membership.
565This is a separate set of groups from the primary group, and you should avoid
566nominating the same group as both primary and extra groups.
567In other words, these extra groups determine membership in groups
568.Em other than
569the primary group.
570.Ar grouplist
571is a comma-separated list of group names or ids, and are always
572stored in
573.Pa /etc/pw.conf
574by their symbolic names.
575.It Fl L Ar class
576This option sets the default login class for new users.
577.It Fl k Ar dir
578Set the default
579.Em skeleton
580directory, from which prototype shell and other initialization files are copied when
581.Nm
582creates a user's home directory.
583.It Xo
584.Fl u Ar min , Ns Ar max ,
585.Fl i Ar min , Ns Ar max
586.Xc
587These options set the minimum and maximum user and group ids allocated for new accounts
588and groups created by
589.Nm .
590The default values for each is 1000 minimum and 32000 maximum.
591.Ar min
592and
593.Ar max
594are both numbers, where max must be greater than min, and both must be between 0
595and 32767.
596In general, user and group ids less than 100 are reserved for use by the system,
597and numbers greater than 32000 may also be reserved for special purposes (used by
598some system daemons).
599.It Fl w Ar method
600The
601.Fl w
602option sets the default method used to set passwords for newly created user accounts.
603.Ar method
604is one of:
605.Pp
606.Bl -tag -width random -offset indent -compact
607.It no
608disable login on newly created accounts
609.It yes
610force the password to be the account name
611.It none
612force a blank password
613.It random
614generate a random password
615.El
616.Pp
617The
618.Ql \&random
619or
620.Ql \&no
621methods are the most secure; in the former case,
622.Nm
623generates a password and prints it to stdout, which is suitable where you issue
624users with passwords to access their accounts rather than having the user nominate
625their own (possibly poorly chosen) password.
626The
627.Ql \&no
628method requires that the superuser use
629.Xr passwd 1
630to render the account accessible with a password.
631.It Fl y Ar path
632This sets the pathname of the database used by NIS if you are not sharing
633the information from
634.Pa /etc/master.passwd
635directly with NIS.
636You should only set this option for NIS servers.
637.El
638.Pp
639The
640.Ar userdel
641command has only three valid options.
642The
643.Fl n Ar name
644and
645.Fl u Ar uid
646options have already been covered above.
647The additional option is:
648.Bl -tag -width "-G grouplist"
649.It Fl r
650This tells
651.Nm
652to remove the user's home directory and all of its contents.
653.Nm Pw
654errs on the side of caution when removing files from the system.
655Firstly, it will not do so if the uid of the account being removed is also used by
656another account on the system, and the 'home' directory in the password file is
657a valid path that commences with the character
658.Ql \&/ .
659Secondly, it will only remove files and directories that are actually owned by
660the user, or symbolic links owned by anyone under the user's home directory.
661Finally, after deleting all contents owned by the user only empty directories
662will be removed.
663If any additional cleanup work is required, this is left to the administrator.
664.El
665.Pp
666Mail spool files and crontabs are always removed when an account is deleted as these
667are unconditionally attached to the user name.
668Jobs queued for processing by
669.Ar at
670are also removed if the user's uid is unique and not also used by another account on the
671system.
672.Pp
673The
674.Ar usershow
675command allows viewing of an account in one of two formats.
676By default, the format is identical to the format used in
677.Pa /etc/master.passwd
678with the password field replaced with a
679.Ql \&* .
680If the
681.Fl P
682option is used, then
683.Nm
684outputs the account details in a more human readable form.
685If the
686.Fl 7
687option is used, the account details are shown in v7 format.
688The
689.Fl a
690option lists all users currently on file.
691Using
692.Fl F
693forces
694.Nm
695to print the details of an account even if it does not exist.
696.Pp
697The command
698.Ar usernext
699returns the next available user and group ids separated by a colon.
700This is normally of interest only to interactive scripts or front-ends
701that use
702.Nm .
703.Sh GROUP OPTIONS
704The
705.Fl C
706and
707.Fl q
708options (explained at the start of the previous section) are available
709with the group manipulation commands.
710Other common options to all group-related commands are:
711.Bl -tag -width "-m newmembers"
712.It Fl n Ar name
713Specify the group name.
714.It Fl g Ar gid
715Specify the group numeric id.
716.Pp
717As with the account name and id fields, you will usually only need
718to supply one of these, as the group name implies the uid and vice
719versa.
720You will only need to use both when setting a specific group id
721against a new group or when changing the uid of an existing group.
722.It Fl M Ar memberlist
723This option provides an alternative way to add existing users to a
724new group (in groupadd) or replace an existing membership list (in
725groupmod).
726.Ar memberlist
727is a comma separated list of valid and existing user names or uids.
728.It Fl m Ar newmembers
729Similar to
730.Fl M ,
731this option allows the
732.Em addition
733of existing users to a group without replacing the existing list of
734members.
735Login names or user ids may be used, and duplicate users are
736silently eliminated.
737.El
738.Pp
739.Ar groupadd
740also has a
741.Fl o
742option that allows allocation of an existing group id to a new group.
743The default action is to reject an attempt to add a group, and this option overrides
744the check for duplicate group ids.
745There is rarely any need to duplicate a group id.
746.Pp
747The
748.Ar groupmod
749command adds one additional option:
750.Pp
751.Bl -tag -width "-m newmembers"
752.It Fl l Ar name
753This option allows changing of an existing group name to
754.Ql \&name .
755The new name must not already exist, and any attempt to duplicate an existing group
756name will be rejected.
757.El
758.Pp
759Options for
760.Ar groupshow
761are the same as for
762.Ar usershow ,
763with the
764.Fl g Ar gid
765replacing
766.Fl u Ar uid
767to specify the group id.
768The
769.Fl 7
770option does not apply to the
771.Ar groupshow
772command.
773.Pp
774The command
775.Ar groupnext
776returns the next available group id on standard output.
777.Sh USER LOCKING
778.Nm Pw
779supports a simple password locking mechanism for users; it works by
780prepending the string
781.Ql *LOCKED*
782to the beginning of the password field in
783.Pa master.passwd
784to prevent successful authentication.
785.Pp
786The
787.Ar lock
788and
789.Ar unlock
790commands take a user name or uid of the account to lock or unlock,
791respectively.  The
792.Fl V ,
793.Fl C ,
794and
795.Fl q
796options as described above are accepted by these commands.
797.Sh DIAGNOSTICS
798.Nm Pw
799returns EXIT_SUCCESS on successful operation, otherwise
800.Nm
801returns one of the
802following exit codes defined by
803.Xr sysexits 3
804as follows:
805.Bl -tag -width xxxx
806.It EX_USAGE
807.Bl -bullet -compact
808.It
809Command line syntax errors (invalid keyword, unknown option).
810.El
811.It EX_NOPERM
812.Bl -bullet -compact
813.It
814Attempting to run one of the update modes as non-root.
815.El
816.It EX_OSERR
817.Bl -bullet -compact
818.It
819Memory allocation error.
820.It
821Read error from password file descriptor.
822.El
823.It EX_DATAERR
824.Bl -bullet -compact
825.It
826Bad or invalid data provided or missing on the command line or
827via the password file descriptor.
828.It
829Attempted to remove, rename root account or change its uid.
830.El
831.It EX_OSFILE
832.Bl -bullet -compact
833.It
834Skeleton directory is invalid or does not exist.
835.It
836Base home directory is invalid or does not exist.
837.It
838Invalid or non-existent shell specified.
839.El
840.It EX_NOUSER
841.Bl -bullet -compact
842.It
843User, user id, group or group id specified does not exist.
844.It
845User or group recorded, added, or modified unexpectedly disappeared.
846.El
847.It EX_SOFTWARE
848.Bl -bullet -compact
849.It
850No more group or user ids available within specified range.
851.El
852.It EX_IOERR
853.Bl -bullet -compact
854.It
855Unable to rewrite configuration file.
856.It
857Error updating group or user database files.
858.It
859Update error for passwd or group database files.
860.El
861.It EX_CONFIG
862.Bl -bullet -compact
863.It
864No base home directory configured.
865.El
866.El
867.Sh NOTES
868For a summary of options available with each command, you can use
869.Dl pw [command] help
870For example,
871.Dl pw useradd help
872lists all available options for the useradd operation.
873.Pp
874.Nm Pw
875allows 8-bit characters in the passwd GECOS field (user's full name,
876office, work and home phone number subfields), but disallows them in
877user login and group names.
878Use 8-bit characters with caution, as connection to the Internet will
879require that your mail transport program supports 8BITMIME, and will
880convert headers containing 8-bit characters to 7-bit quoted-printable
881format.
882.Xr sendmail 8
883does support this.
884Use of 8-bit characters in the GECOS field should be used in
885conjunction with the user's default locale and character set
886and should not be implemented without their use.
887Using 8-bit characters may also affect other
888programs that transmit the contents of the GECOS field over the
889Internet, such as
890.Xr fingerd 8 ,
891and a small number of TCP/IP clients, such as IRC, where full names
892specified in the passwd file may be used by default.
893.Sh FILES
894.Bl -tag -width /etc/master.passwd.new -compact
895.It Pa /etc/master.passwd
896The user database
897.It Pa /etc/passwd
898A Version 7 format password file
899.It Pa /etc/login.conf
900The user capabilities database
901.It Pa /etc/group
902The group database
903.It Pa /etc/master.passwd.new
904Temporary copy of the master password file
905.It Pa /etc/passwd.new
906Temporary copy of the Version 7 password file
907.It Pa /etc/group.new
908Temporary copy of the group file
909.It Pa /etc/pw.conf
910Pw default options file
911.El
912.Sh SEE ALSO
913.Xr chpass 1 ,
914.Xr passwd 1 ,
915.Xr group 5 ,
916.Xr login.conf 5 ,
917.Xr passwd 5 ,
918.Xr pw.conf 5 ,
919.Xr pwd_mkdb 8 ,
920.Xr vipw 8
921.Sh HISTORY
922.Nm Pw
923was written to mimic many of the options used in the SYSV
924.Em shadow
925support suite, but is modified for passwd and group fields specific to
926the
927.Bx 4.4
928operating system, and combines all of the major elements
929into a single command.
930