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