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.\" 251dcc6ec7SPhilippe Charnier.\" $Id: pw.8,v 1.10 1997/03/04 07:55:43 danny 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 1591dcc6ec7SPhilippe Charnier.Nm Pw 160d6f907dcSJoerg Wunschis a command-line based editor for the system 1611dcc6ec7SPhilippe Charnier.Ar user 162d6f907dcSJoerg Wunschand 1631dcc6ec7SPhilippe Charnier.Ar 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 1671dcc6ec7SPhilippe Charnier.Nm 168d6f907dcSJoerg Wunschonly operates on the local user and group files; NIS users and groups must be 169d6f907dcSJoerg Wunschmaintained on the NIS server. 1701dcc6ec7SPhilippe Charnier.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 1951dcc6ec7SPhilippe Charnier.Nm 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, 2091dcc6ec7SPhilippe Charnier.Nm 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 2211dcc6ec7SPhilippe Charnier.Nm 222d6f907dcSJoerg Wunschto suppress error messages, which may be useful in interactive environments where it 223d6f907dcSJoerg Wunschis preferable to interpret status codes returned by 2241dcc6ec7SPhilippe Charnier.Nm 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 2281dcc6ec7SPhilippe Charnier.Nm 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 2361dcc6ec7SPhilippe Charnier.Nm 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 2581dcc6ec7SPhilippe CharnierSpecify the user/account name. 259d6f907dcSJoerg Wunsch.It Fl u Ar uid 2601dcc6ec7SPhilippe CharnierSpecify 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 2791dcc6ec7SPhilippe Charnier.Nm 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 3111dcc6ec7SPhilippe Charnier- normally 3121dcc6ec7SPhilippe Charnier.Pa /home 3131dcc6ec7SPhilippe Charnier- with the account name as a subdirectory). 314d6f907dcSJoerg Wunsch.It Fl e Ar date 3151dcc6ec7SPhilippe CharnierSet the account's expiration date. 316d6f907dcSJoerg WunschFormat of the date is either a UNIX time in decimal, or a date in 317d6f907dcSJoerg Wunsch.Ql \& dd-mmm-yy[yy] 318d6f907dcSJoerg Wunschformat, where dd is the day, mmm is the month, either in numeric or alphabetic format 3191dcc6ec7SPhilippe Charnier('Jan', 'Feb', etc) and year is either a two or four digit year. 320d6f907dcSJoerg WunschThis option also accepts a relative date in the form 321d6f907dcSJoerg Wunsch.Ql \&+n[mhdwoy] 322d6f907dcSJoerg Wunschwhere 323d6f907dcSJoerg Wunsch.Ql \&n 324d6f907dcSJoerg Wunschis a decimal, octal (leading 0) or hexadecimal (leading 0x) digit followed by the 325053375e8SMike Pritchardnumber of Minutes, Hours, Days, Weeks, Months or Years from the current date at 326d6f907dcSJoerg Wunschwhich the expiry date is to be set. 327d6f907dcSJoerg Wunsch.It Fl p Ar date 3281dcc6ec7SPhilippe CharnierSet the account's password expiration date. 329d6f907dcSJoerg WunschThis field is identical to the account expiration date option, except that it 330d6f907dcSJoerg Wunschapplies to forced password changes. 331053375e8SMike PritchardThe same formats are accepted as with the account expiration option. 332d6f907dcSJoerg Wunsch.It Fl g Ar group 3331dcc6ec7SPhilippe CharnierSet the account's primary group to the given group. 334d6f907dcSJoerg Wunsch.Ar group 335d6f907dcSJoerg Wunschmay be either the group name or its corresponding group id number. 336d6f907dcSJoerg Wunsch.It Fl G Ar grouplist 337d6f907dcSJoerg WunschSets the additional groups to which an account belongs. 338d6f907dcSJoerg Wunsch.Ar grouplist 339d6f907dcSJoerg Wunschis a comma-separated list or group names or group ids. 340d6f907dcSJoerg WunschWhen adding a user, the user's name is added to the group lists in 341d6f907dcSJoerg Wunsch.Pa /etc/group , 342d6f907dcSJoerg Wunschand when editing a user, the user's name is also added to the group lists, and 343d6f907dcSJoerg Wunschremoved from any groups not specified in 344d6f907dcSJoerg Wunsch.Ar grouplist . 345d6f907dcSJoerg WunschNote: a user should not be added to their primary group in 346d6f907dcSJoerg Wunsch.Pa /etc/group . 347d6f907dcSJoerg WunschAlso, group membership changes do not take effect immediately for current logins, 348d6f907dcSJoerg Wunschonly logins subsequent to the change. 3499fd0dafcSJoerg Wunsch.It Fl L Ar class 3509fd0dafcSJoerg WunschThis option sets the login class for the user being created. 3519fd0dafcSJoerg WunschSee 3529fd0dafcSJoerg Wunsch.Xr login.conf 5 3539fd0dafcSJoerg Wunschfor more information on user classes. 354d6f907dcSJoerg Wunsch.It Fl m 355d6f907dcSJoerg WunschThis option instructs 3561dcc6ec7SPhilippe Charnier.Nm 357d6f907dcSJoerg Wunschto attempt to create the user's home directory. 358d6f907dcSJoerg WunschWhile primarily useful when adding a new account with 359d6f907dcSJoerg Wunsch.Ar useradd , 360d6f907dcSJoerg Wunschthis may also be of use when moving an existing user's home directory elsewhere on 361d6f907dcSJoerg Wunschthe filesystem. 362d6f907dcSJoerg WunschThe new home directory is populated with the contents of the 363d6f907dcSJoerg Wunsch.Ar skeleton 364d6f907dcSJoerg Wunschdirectory, which typically contains a set of shell configuration files that the 365053375e8SMike Pritcharduser may personalize to taste. 366d6f907dcSJoerg WunschWhen 367d6f907dcSJoerg Wunsch.Ql Fl m 368d6f907dcSJoerg Wunschis used on an account with 369d6f907dcSJoerg Wunsch.Ar usermod , 370d6f907dcSJoerg Wunschany existing configuration files in the user's home directory are 371d6f907dcSJoerg Wunsch.Em not 372d6f907dcSJoerg Wunschoverwritten with the prototype files. 373d6f907dcSJoerg Wunsch.Pp 374d6f907dcSJoerg WunschWhen a user's home directory is created, it will be default be as a subdirectory of the 375d6f907dcSJoerg Wunsch.Ar basehome 376d6f907dcSJoerg Wunschdirectory specified with the 377d6f907dcSJoerg Wunsch.Ql Fl b Ar dir 378d6f907dcSJoerg Wunschoption (see below), and will be named the same as the account. 379d6f907dcSJoerg WunschThis may be overridden with the 380d6f907dcSJoerg Wunsch.Ql Fl d Ar dir 381d6f907dcSJoerg Wunschoption on the command line, if desired. 382d6f907dcSJoerg Wunsch.It Fl k Ar dir 3831dcc6ec7SPhilippe CharnierSet the 384d6f907dcSJoerg Wunsch.Ar skeleton 385d6f907dcSJoerg Wunschsubdirectory, from which the basic startup and configuration files are copied when 386d6f907dcSJoerg Wunschthe user's home directory is created. 387d6f907dcSJoerg WunschThis option only has meaning when used with 388d6f907dcSJoerg Wunsch.Ql Fl D 389d6f907dcSJoerg Wunsch(see below) or 390d6f907dcSJoerg Wunsch.Ql Fl m . 391d6f907dcSJoerg Wunsch.It Fl s Ar shell 3921dcc6ec7SPhilippe CharnierSet or changes the user's login shell to 393d6f907dcSJoerg Wunsch.Ar shell . 394d6f907dcSJoerg WunschIf the path to the shell program is omitted, 3951dcc6ec7SPhilippe Charnier.Nm 396d6f907dcSJoerg Wunschsearches the 397d6f907dcSJoerg Wunsch.Ar shellpath 398d6f907dcSJoerg Wunschspecified in 399d6f907dcSJoerg Wunsch.Pa /etc/pw.conf 400d6f907dcSJoerg Wunschand fills it in as appropriate. 401d6f907dcSJoerg WunschNote that unless you have a specific reason to do so, you should avoid 402d6f907dcSJoerg Wunschspecifying the path - this will allow 4031dcc6ec7SPhilippe Charnier.Nm 404d6f907dcSJoerg Wunschto validate that the program exists and is executable. 405d6f907dcSJoerg WunschSpecifying a full path (or supplying a blank "" shell) avoids this check 406d6f907dcSJoerg Wunschand allows for such entries as 4071dcc6ec7SPhilippe Charnier.Pa /nonexistent 408d6f907dcSJoerg Wunschthat should be set for accounts not intended for interactive login. 409d6f907dcSJoerg Wunsch.It Fl L Ar class 4101dcc6ec7SPhilippe CharnierSet the 411d6f907dcSJoerg Wunsch.Em class 412d6f907dcSJoerg Wunschfield in the user's passwd record. 413d6f907dcSJoerg WunschThis field is not currently used, but will be in the future used to specify a 414d6f907dcSJoerg Wunsch.Em termcap 415d6f907dcSJoerg Wunschentry like tag (see 416d6f907dcSJoerg Wunsch.Xr passwd 5 417d6f907dcSJoerg Wunschfor details). 418d6f907dcSJoerg Wunsch.It Fl h Ar fd 419d6f907dcSJoerg WunschThis option provides a special interface by which interactive scripts can 420d6f907dcSJoerg Wunschset an account password using 421d6f907dcSJoerg Wunsch.Nm pw . 422d6f907dcSJoerg WunschBecause the command line and environment are fundamental insecure mechanisms 423d6f907dcSJoerg Wunschby which programs can accept information, 4241dcc6ec7SPhilippe Charnier.Nm 425d6f907dcSJoerg Wunschwill only allow setting of account and group passwords via a file descriptor 426d6f907dcSJoerg Wunsch(usually a pipe between an interactive script and the program). 427d6f907dcSJoerg Wunsch.Ar sh , 428d6f907dcSJoerg Wunsch.Ar bash , 429d6f907dcSJoerg Wunsch.Ar ksh 430d6f907dcSJoerg Wunschand 431d6f907dcSJoerg Wunsch.Ar perl 432d6f907dcSJoerg Wunschall posses mechanisms by which this can be done. 433d6f907dcSJoerg WunschAlternatively, 434d6f907dcSJoerg Wunsch.Nm pw 435d6f907dcSJoerg Wunschwill prompt for the user's password if 436d6f907dcSJoerg Wunsch.Ql Fl h Ar 0 437d6f907dcSJoerg Wunschis given, nominating 438d6f907dcSJoerg Wunsch.Em stdin 439d6f907dcSJoerg Wunschas the file descriptor on which to read the password. 440d6f907dcSJoerg WunschNote that this password will be read once and once only and is intended 441d6f907dcSJoerg Wunschfor use by a script or similar rather than interactive use. 442d6f907dcSJoerg WunschIf you wish to have new password confirmation along the lines of 443d6f907dcSJoerg Wunsch.Xr passwd 1 , 444d6f907dcSJoerg Wunschthis must be implemented as part of the interactive script that calls 445d6f907dcSJoerg Wunsch.Nm pw . 446d6f907dcSJoerg Wunsch.Pp 447d6f907dcSJoerg WunschIf a value of 448d6f907dcSJoerg Wunsch.Ql \&- 449d6f907dcSJoerg Wunschis given as the argument 450d6f907dcSJoerg Wunsch.Ar fd , 451d6f907dcSJoerg Wunschthen the password will be set to 452d6f907dcSJoerg Wunsch.Ql \&* , 453d6f907dcSJoerg Wunschrendering the account inaccessible via passworded login. 454d6f907dcSJoerg Wunsch.El 455d6f907dcSJoerg Wunsch.Pp 456d6f907dcSJoerg WunschIt is possible to use 457d6f907dcSJoerg Wunsch.Ar useradd 458d6f907dcSJoerg Wunschto create a new account that duplicates an existing user id. 459d6f907dcSJoerg WunschWhile this is normally considered an error and will be rejected, the 460d6f907dcSJoerg Wunsch.Ql Fl o 4619fd0dafcSJoerg Wunschoption overrides the check for duplicates and allows the duplication of 4629fd0dafcSJoerg Wunschthe user id. 4639fd0dafcSJoerg WunschThis may be useful if you allow the same user to login under 4649fd0dafcSJoerg Wunschdifferent contexts (different group allocations, different home 4659fd0dafcSJoerg Wunschdirectory, different shell) while providing basically the same 4669fd0dafcSJoerg Wunschpermissions for access to the user's files in each account. 467d6f907dcSJoerg Wunsch.Pp 468d6f907dcSJoerg WunschThe 469d6f907dcSJoerg Wunsch.Ar useradd 470d6f907dcSJoerg Wunschcommand also has the ability to set new user and group defaults by using the 471d6f907dcSJoerg Wunsch.Ql Fl D 4729fd0dafcSJoerg Wunschoption. 473d6f907dcSJoerg WunschInstead of adding a new user, 4741dcc6ec7SPhilippe Charnier.Nm 475d6f907dcSJoerg Wunschwrites a new set of defaults to its configuration file, 476d6f907dcSJoerg Wunsch.Pa /etc/pw.conf . 477d6f907dcSJoerg WunschWhen using the 478d6f907dcSJoerg Wunsch.Ql Fl D 4799fd0dafcSJoerg Wunschoption, you must not use either 480d6f907dcSJoerg Wunsch.Ql Fl n Ar name 481d6f907dcSJoerg Wunschor 482d6f907dcSJoerg Wunsch.Ql Fl u Ar uid 483d6f907dcSJoerg Wunschor an error will result. 484d6f907dcSJoerg WunschUse of 485d6f907dcSJoerg Wunsch.Ql Fl D 4869fd0dafcSJoerg Wunschchanges the meaning of several command line switches in the 487d6f907dcSJoerg Wunsch.Ar useradd 488d6f907dcSJoerg Wunschcommand. 489d6f907dcSJoerg WunschThese are: 490d6f907dcSJoerg Wunsch.Bl -tag -width "-G grouplist" 491d6f907dcSJoerg Wunsch.It Fl D 492d6f907dcSJoerg WunschSet default values in 493d6f907dcSJoerg Wunsch.Pa /etc/pw.conf 494d6f907dcSJoerg Wunschconfiguration file, or a different named configuration file if the 495d6f907dcSJoerg Wunsch.Ql Fl C Ar config 4969fd0dafcSJoerg Wunschoption is used. 497d6f907dcSJoerg Wunsch.It Fl b Ar dir 4981dcc6ec7SPhilippe CharnierSet the root directory in which user home directories are created. 499d6f907dcSJoerg WunschThe default value for this is 5001dcc6ec7SPhilippe Charnier.Pa /home , 501d6f907dcSJoerg Wunschbut it may be set elsewhere as desired. 502d6f907dcSJoerg Wunsch.It Fl e Ar days 5031dcc6ec7SPhilippe CharnierSet the default account expiration period in days. 504d6f907dcSJoerg WunschUnlike use without 505d6f907dcSJoerg Wunsch.Ql Fl D , 506d6f907dcSJoerg Wunschthe argument must be numeric, which specifies the number of days after creation when 507d6f907dcSJoerg Wunschthe account is to expire. 508d6f907dcSJoerg WunschA value of 0 suppresses automatic calculation of the expiry date. 509d6f907dcSJoerg Wunsch.It Fl p Ar days 5101dcc6ec7SPhilippe CharnierSet the default password expiration period in days. 511d6f907dcSJoerg Wunsch.It Fl g Ar group 5121dcc6ec7SPhilippe CharnierSet the default group for new users. 513d6f907dcSJoerg WunschIf a blank group is specified using 514d6f907dcSJoerg Wunsch.Ql Fl g Ar \&"" , 515d6f907dcSJoerg Wunschthen new users will be allocated their own private primary group (a new group created 516d6f907dcSJoerg Wunschwith the same name as their login name). 517d6f907dcSJoerg WunschIf a group is supplied, either its name or uid may be given as an argument. 518d6f907dcSJoerg Wunsch.It Fl G Ar grouplist 5191dcc6ec7SPhilippe CharnierSet the default groups in which new users are made members. 520d6f907dcSJoerg WunschThis is a separate set of groups from the primary group, and you should avoid 521d6f907dcSJoerg Wunschnominating the same group as both the primary and in extra groups. 522d6f907dcSJoerg WunschIn other words, these extra groups determine membership in groups 523d6f907dcSJoerg Wunsch.Em other than 524d6f907dcSJoerg Wunschthe primary group. 525d6f907dcSJoerg Wunsch.Ar grouplist 526d6f907dcSJoerg Wunschis a comma-separated list of group names or ids, or a mixture of both, and are always 527d6f907dcSJoerg Wunschstored in 528d6f907dcSJoerg Wunsch.Pa /etc/pw.conf 529d6f907dcSJoerg Wunschby their symbolic names. 5309fd0dafcSJoerg Wunsch.It Fl L Ar class 5319fd0dafcSJoerg WunschThis option sets the default login class for new users. 532d6f907dcSJoerg Wunsch.It Fl k Ar dir 5331dcc6ec7SPhilippe CharnierSet the default 534d6f907dcSJoerg Wunsch.Em skeleton 535053375e8SMike Pritcharddirectory, from which prototype shell and other initialization files are copied when 5361dcc6ec7SPhilippe Charnier.Nm 537d6f907dcSJoerg Wunschcreates a user's home directory. 5389fd0dafcSJoerg Wunsch.It Fl u Ar min,max , Fl i Ar min,max 5399fd0dafcSJoerg WunschThese options set the minimum and maximum user and group ids allocated for new accounts 540d6f907dcSJoerg Wunschand groups created by 541d6f907dcSJoerg Wunsch.Nm pw . 542d6f907dcSJoerg WunschThe default values for each is 1000 minimum and 32000 maximum. 543d6f907dcSJoerg Wunsch.Ar min 544d6f907dcSJoerg Wunschand 545d6f907dcSJoerg Wunsch.Ar max 546d6f907dcSJoerg Wunschare both numbers, where max must be greater than min, and both must be between 0 547d6f907dcSJoerg Wunschand 32767. 548d6f907dcSJoerg WunschIn general, user and group ids less than 100 are reserved for use by the system, 549d6f907dcSJoerg Wunschand numbers greater than 32000 may also be reserved for special purposes (used by 550d6f907dcSJoerg Wunschsome system daemons). 551d6f907dcSJoerg Wunsch.It Fl w Ar method 552d6f907dcSJoerg WunschThe 553d6f907dcSJoerg Wunsch.Ql Fl w 5549fd0dafcSJoerg Wunschoption sets the default method used to set passwords for newly created user accounts. 555d6f907dcSJoerg Wunsch.Ar method 556d6f907dcSJoerg Wunschis one of: 557d6f907dcSJoerg Wunsch.Pp 558d6f907dcSJoerg Wunsch.Bl -tag -width random -offset indent -compact 559d6f907dcSJoerg Wunsch.It no 5601dcc6ec7SPhilippe Charnierdisable login on newly created accounts 561d6f907dcSJoerg Wunsch.It yes 5621dcc6ec7SPhilippe Charnierforce the password to be the account name 563d6f907dcSJoerg Wunsch.It none 5641dcc6ec7SPhilippe Charnierforce a blank password 565d6f907dcSJoerg Wunsch.It random 5661dcc6ec7SPhilippe Charniergenerate a random password 567d6f907dcSJoerg Wunsch.El 568d6f907dcSJoerg Wunsch.Pp 569d6f907dcSJoerg WunschThe 570d6f907dcSJoerg Wunsch.Ql \&random 571d6f907dcSJoerg Wunschor 572d6f907dcSJoerg Wunsch.Ql \&no 573d6f907dcSJoerg Wunschmethods are the most secure; in the former case, 5741dcc6ec7SPhilippe Charnier.Nm 575d6f907dcSJoerg Wunschgenerates a password and prints it to stdout, which is suitable where you issue 576d6f907dcSJoerg Wunschusers with passwords to access their accounts rather than having the user nominate 577d6f907dcSJoerg Wunschtheir own (possibly poorly chosen) password. 578d6f907dcSJoerg WunschThe 579d6f907dcSJoerg Wunsch.Ql \&no 580d6f907dcSJoerg Wunschmethod requires that the superuser use 581d6f907dcSJoerg Wunsch.Xr passwd 1 582d6f907dcSJoerg Wunschto render the account accessible with a password. 583f1d684faSDavid Nugent.It Fl y Ar path 584f1d684faSDavid NugentThis sets the pathname of the database used by NIS if you are not sharing 585f1d684faSDavid Nugentthe information from 586f1d684faSDavid Nugent.Pa /etc/master.passwd 587f1d684faSDavid Nugentdirectly with NIS. 588f1d684faSDavid NugentYou should only set this option on NIS servers. 589d6f907dcSJoerg Wunsch.El 590d6f907dcSJoerg Wunsch.Pp 591d6f907dcSJoerg WunschThe 592d6f907dcSJoerg Wunsch.Ar userdel 5939fd0dafcSJoerg Wunschcommand has only three valid options. The 594d6f907dcSJoerg Wunsch.Ql Fl n Ar name 595d6f907dcSJoerg Wunschand 596d6f907dcSJoerg Wunsch.Ql Fl u Ar uid 5979fd0dafcSJoerg Wunschoptions have already been covered above. 5989fd0dafcSJoerg WunschThe additional option is: 5999fd0dafcSJoerg Wunsch.Bl -tag -width "-G grouplist" 600d6f907dcSJoerg Wunsch.It Fl r 601d6f907dcSJoerg WunschThis tells 6021dcc6ec7SPhilippe Charnier.Nm 603d6f907dcSJoerg Wunschto remove the user's home directory and all of its contents. 6041dcc6ec7SPhilippe Charnier.Nm Pw 605d6f907dcSJoerg Wunscherrs on the side of caution when removing files from the system. 606d6f907dcSJoerg WunschFirstly, it will not do so if the uid of the account being removed is also used by 607d6f907dcSJoerg Wunschanother account on the system, and the 'home' directory in the password file is 608d6f907dcSJoerg Wunscha valid path that commences with the character 609d6f907dcSJoerg Wunsch.Ql \&/ . 610d6f907dcSJoerg WunschSecondly, it will only remove files and directories that are actually owned by 611d6f907dcSJoerg Wunschthe user, or symbolic links owned by anyone under the user's home directory. 612d6f907dcSJoerg WunschFinally, after deleting all contents owned by the user only empty directories 613d6f907dcSJoerg Wunschwill be removed. 614053375e8SMike PritchardIf any additional cleanup work is required, this is left to the administrator. 615d6f907dcSJoerg Wunsch.El 616d6f907dcSJoerg Wunsch.Pp 617d6f907dcSJoerg WunschMail spool files and crontabs are always removed when an account is deleted as these 618d6f907dcSJoerg Wunschare unconditionally attached to the user name. 619d6f907dcSJoerg WunschJobs queued for processing by 620d6f907dcSJoerg Wunsch.Ar at 621d6f907dcSJoerg Wunschare also removed if the user's uid is unique (not also used by another account on the 622d6f907dcSJoerg Wunschsystem). 623d6f907dcSJoerg Wunsch.Pp 624d6f907dcSJoerg WunschThe 625d6f907dcSJoerg Wunsch.Ar usershow 626d6f907dcSJoerg Wunschcommand allows viewing of an account in one of two formats. 627d6f907dcSJoerg WunschBy default, the format is identical to the format used in 628d6f907dcSJoerg Wunsch.Pa /etc/master.passwd 629d6f907dcSJoerg Wunschwith the password field replaced with a 630d6f907dcSJoerg Wunsch.Ql \&* . 631d6f907dcSJoerg WunschIf the 6329fd0dafcSJoerg Wunsch.Ql Fl P 6339fd0dafcSJoerg Wunschoption is used, then 6341dcc6ec7SPhilippe Charnier.Nm 635d6f907dcSJoerg Wunschoutputs the account details in a more human readable form. 636d6f907dcSJoerg WunschThe 637d6f907dcSJoerg Wunsch.Ql Fl a 6389fd0dafcSJoerg Wunschoption lists all users currently on file. 6399fd0dafcSJoerg Wunsch.Pp 6409fd0dafcSJoerg WunschThe command 6419fd0dafcSJoerg Wunsch.Ar usernext 6429fd0dafcSJoerg Wunschreturns the next available user and group ids separated by a colon. 6439fd0dafcSJoerg WunschThis is normally of interest only to interactive scripts or front-ends 6449fd0dafcSJoerg Wunschthat use 6459fd0dafcSJoerg Wunsch.Nm pw . 646d6f907dcSJoerg Wunsch.Pp 647d6f907dcSJoerg Wunsch.Sh GROUP OPTIONS 648d6f907dcSJoerg WunschThe 649d6f907dcSJoerg Wunsch.Ql Fl C Ar config 650d6f907dcSJoerg Wunschand 651d6f907dcSJoerg Wunsch.Ql Fl q 6529fd0dafcSJoerg Wunschoptions (explained at the start of the previous section) are available 6539fd0dafcSJoerg Wunschwith the group manipulation commands. 654d6f907dcSJoerg WunschOther common options to all group-related commands are: 6559fd0dafcSJoerg Wunsch.Bl -tag -width "-m newmembers" 656d6f907dcSJoerg Wunsch.It Fl n Ar name 6571dcc6ec7SPhilippe CharnierSpecify the group name. 658d6f907dcSJoerg Wunsch.It Fl g Ar gid 6591dcc6ec7SPhilippe CharnierSpecify the group numeric id. 660d6f907dcSJoerg Wunsch.Pp 6619fd0dafcSJoerg WunschAs with the account name and id fields, you will usually only need 6629fd0dafcSJoerg Wunschto supply one of these, as the group name implies the uid and vice 6639fd0dafcSJoerg Wunschversa. 6649fd0dafcSJoerg WunschYou will only need to use both when setting a specific group id 6659fd0dafcSJoerg Wunschagainst a new group or when changing the uid of an existing group. 6669fd0dafcSJoerg Wunsch.It Fl M Ar memberlist 6679fd0dafcSJoerg WunschThis option provides an alternative way to add existing users to a 6689fd0dafcSJoerg Wunschnew group (in groupadd) or replace an existing membership list (in 6699fd0dafcSJoerg Wunschgroupmod). 6709fd0dafcSJoerg Wunsch.Ar memberlist 6719fd0dafcSJoerg Wunschis a comma separated list of valid and existing user names or uids. 6729fd0dafcSJoerg Wunsch.It Fl m Ar newmembers 6739fd0dafcSJoerg WunschSimilar to 6749fd0dafcSJoerg Wunsch.Op M , 6759fd0dafcSJoerg Wunschthis option allows the 6769fd0dafcSJoerg Wunsch.Em addition 6779fd0dafcSJoerg Wunschof existing users to a group without first replacing the existing list of 6789fd0dafcSJoerg Wunschmembers. 6799fd0dafcSJoerg WunschLogin names or user ids may be used, and duplicated users are automatically 6809fd0dafcSJoerg Wunschand silently eliminated. 681d6f907dcSJoerg Wunsch.El 682d6f907dcSJoerg Wunsch.Pp 683d6f907dcSJoerg Wunsch.Ar groupadd 684d6f907dcSJoerg Wunschalso has a 685d6f907dcSJoerg Wunsch.Ql Fl o 686d6f907dcSJoerg Wunschoption that allows allocation of an existing group id to new group. 687d6f907dcSJoerg WunschThe default action is to reject an attempt to add a group, and this option overrides 688d6f907dcSJoerg Wunschthe check for duplicate group ids. 689d6f907dcSJoerg WunschThere is rarely any need to duplicate a group id. 690d6f907dcSJoerg Wunsch.Pp 691d6f907dcSJoerg WunschThe 692d6f907dcSJoerg Wunsch.Ar groupmod 6939fd0dafcSJoerg Wunschcommand adds one additonal option: 694d6f907dcSJoerg Wunsch.Pp 6959fd0dafcSJoerg Wunsch.Bl -tag -width "-m newmembers" 696d6f907dcSJoerg Wunsch.It Fl l Ar name 697d6f907dcSJoerg WunschThis option allows changing of an existing group name to 698d6f907dcSJoerg Wunsch.Ql \&name . 699d6f907dcSJoerg WunschThe new name must not already exist, and any attempt to duplicate an existing group 700d6f907dcSJoerg Wunschname will be rejected. 701d6f907dcSJoerg Wunsch.El 702d6f907dcSJoerg Wunsch.Pp 703d6f907dcSJoerg WunschOptions for 704d6f907dcSJoerg Wunsch.Ar groupshow 705d6f907dcSJoerg Wunschare the same as for 706d6f907dcSJoerg Wunsch.Ar usershow , 707d6f907dcSJoerg Wunschwith the 708d6f907dcSJoerg Wunsch.Ql Fl g Ar gid 709d6f907dcSJoerg Wunschreplacing 710d6f907dcSJoerg Wunsch.Ql Fl u Ar uid 711d6f907dcSJoerg Wunschto specify the group id. 712d6f907dcSJoerg Wunsch.Pp 7139fd0dafcSJoerg WunschThe command 7149fd0dafcSJoerg Wunsch.Ar groupnext 7159fd0dafcSJoerg Wunschreturns the next available group id on standard output. 7169fd0dafcSJoerg Wunsch.Sh DIAGNOSTICS 7171dcc6ec7SPhilippe Charnier.Nm Pw 7189fd0dafcSJoerg Wunschreturns EXIT_SUCCESS on successful operation, otherwise one of the 7199fd0dafcSJoerg Wunschfollowing exit codes defined by 7209fd0dafcSJoerg Wunsch.Xr sysexits 3 7219fd0dafcSJoerg Wunschas follows: 7229fd0dafcSJoerg Wunsch.Bl -tag -width xxxx 7239fd0dafcSJoerg Wunsch.It EX_USAGE 7249fd0dafcSJoerg Wunsch.Bl -bullet -compact 7259fd0dafcSJoerg Wunsch.It 7261dcc6ec7SPhilippe CharnierCommand line syntax errors (invalid keyword, unknown option). 7279fd0dafcSJoerg Wunsch.El 7289fd0dafcSJoerg Wunsch.It EX_NOPERM 7299fd0dafcSJoerg Wunsch.Bl -bullet -compact 7309fd0dafcSJoerg Wunsch.It 7319fd0dafcSJoerg WunschAttempting to run one of the update modes as non-root. 7329fd0dafcSJoerg Wunsch.El 7339fd0dafcSJoerg Wunsch.It EX_OSERR 7349fd0dafcSJoerg Wunsch.Bl -bullet -compact 7359fd0dafcSJoerg Wunsch.It 7369fd0dafcSJoerg WunschMemory allocation error. 7379fd0dafcSJoerg Wunsch.It 7389fd0dafcSJoerg WunschRead error from password file descriptor. 7399fd0dafcSJoerg Wunsch.El 7409fd0dafcSJoerg Wunsch.It EX_DATAERR 7419fd0dafcSJoerg Wunsch.Bl -bullet -compact 7429fd0dafcSJoerg Wunsch.It 7439fd0dafcSJoerg WunschBad or invalid data provided or missing on the command line or 7449fd0dafcSJoerg Wunschvia the password flie descriptor. 7459fd0dafcSJoerg Wunsch.It 7469fd0dafcSJoerg WunschAttempted to remove, rename root account or change its uid. 7479fd0dafcSJoerg Wunsch.El 7489fd0dafcSJoerg Wunsch.It EX_OSFILE 7499fd0dafcSJoerg Wunsch.Bl -bullet -compact 7509fd0dafcSJoerg Wunsch.It 7519fd0dafcSJoerg WunschSkeleton directory is invalid or does not exist. 7529fd0dafcSJoerg Wunsch.It 7539fd0dafcSJoerg WunschBase home directory is invalid or does not exist. 7549fd0dafcSJoerg Wunsch.It 7559fd0dafcSJoerg WunschInvalid or non-existant shell specified. 7569fd0dafcSJoerg Wunsch.El 7579fd0dafcSJoerg Wunsch.It EX_NOUSER 7589fd0dafcSJoerg Wunsch.Bl -bullet -compact 7599fd0dafcSJoerg Wunsch.It 7609fd0dafcSJoerg WunschUser, user id, group or group id specified does not exist. 7619fd0dafcSJoerg Wunsch.It 7629fd0dafcSJoerg WunschUser or group recorded added or modified unexpectedly disappeared. 7639fd0dafcSJoerg Wunsch.El 7649fd0dafcSJoerg Wunsch.It EX_SOFTWARE 7659fd0dafcSJoerg Wunsch.Bl -bullet -compact 7669fd0dafcSJoerg Wunsch.It 7679fd0dafcSJoerg WunschNo more group or user ids available within specified range. 7689fd0dafcSJoerg Wunsch.El 7699fd0dafcSJoerg Wunsch.It EX_IOERR 7709fd0dafcSJoerg Wunsch.Bl -bullet -compact 7719fd0dafcSJoerg Wunsch.It 7729fd0dafcSJoerg WunschUnable to rewrite configuration file. 7739fd0dafcSJoerg Wunsch.It 7749fd0dafcSJoerg WunschError updating group or user database files. 7759fd0dafcSJoerg Wunsch.It 7769fd0dafcSJoerg WunschUpdate error for passwd or group database files. 7779fd0dafcSJoerg Wunsch.El 7789fd0dafcSJoerg Wunsch.It EX_CONFIG 7799fd0dafcSJoerg Wunsch.Bl -bullet -compact 7809fd0dafcSJoerg Wunsch.It 7819fd0dafcSJoerg WunschNo base home directory configured. 7829fd0dafcSJoerg Wunsch.El 7839fd0dafcSJoerg Wunsch.El 7849fd0dafcSJoerg Wunsch.Pp 785d6f907dcSJoerg Wunsch.Sh NOTES 786d6f907dcSJoerg WunschFor a summary of options available with each command, you can use 787d6f907dcSJoerg Wunsch.Dl pw [command] help 788d6f907dcSJoerg WunschFor example, 789d6f907dcSJoerg Wunsch.Dl pw useradd help 790d6f907dcSJoerg Wunschlists all available options for the useradd operation. 791d9b711b7SDavid Nugent.Pp 7921dcc6ec7SPhilippe Charnier.Nm Pw 793d9b711b7SDavid Nugentallows 8-bit characters in the passwd gecos field (user's full name, 794d9b711b7SDavid Nugentoffice, work and home phone number subfields), but disallows them in 795d9b711b7SDavid Nugentuser login and group names. 796d9b711b7SDavid NugentUse 8-bit characters with caution, as connection to the internet will 797d9b711b7SDavid Nugentrequire that your mail transport program supports 8BITMIME, and will 798d9b711b7SDavid Nugentconvert headers containing 8-bit characters to 7-bit quoted-printable 799d9b711b7SDavid Nugentformat. 800d9b711b7SDavid Nugent.Xr sendmail 8 801d9b711b7SDavid Nugentdoes support this. 802d9b711b7SDavid NugentUse of 8-bit characters in the gecos field should be used in 803d9b711b7SDavid Nugentconjunction with the user's default locale and character set 804d9b711b7SDavid Nugentand should not be implemented without their use. 805d9b711b7SDavid NugentUsing 8-bit characters may also affect other 806d9b711b7SDavid Nugentprograms that transmit the contents of the gecos field over the 807d9b711b7SDavid Nugentinternet, such as 808d9b711b7SDavid Nugent.Xr fingerd 8 , 809d9b711b7SDavid Nugentand a small number of tcpip clients, such as irc, where fullnames 810d9b711b7SDavid Nugentspecified in the passwd file may be used by default. 811d6f907dcSJoerg Wunsch.Sh FILES 812d6f907dcSJoerg Wunsch.Bl -tag -width /etc/master.passwd.new -compact 813d6f907dcSJoerg Wunsch.It Pa /etc/master.passwd 814d6f907dcSJoerg WunschThe user database 815d6f907dcSJoerg Wunsch.It Pa /etc/passwd 816d6f907dcSJoerg WunschA Version 7 format password file 8179fd0dafcSJoerg Wunsch.It Pa /etc/login.conf 8189fd0dafcSJoerg WunschThe user capabilities database 819d6f907dcSJoerg Wunsch.It Pa /etc/group 820d6f907dcSJoerg WunschThe group database 821d6f907dcSJoerg Wunsch.It Pa /etc/master.passwd.new 822d6f907dcSJoerg WunschTemporary copy of the master password file 823d6f907dcSJoerg Wunsch.It Pa /etc/passwd.new 824d6f907dcSJoerg WunschTemporary copy of the Version 7 password file 825d6f907dcSJoerg Wunsch.It Pa /etc/group.new 826d6f907dcSJoerg WunschTemporary copy of the group file 827d6f907dcSJoerg Wunsch.It Pa /etc/pw.conf 828d6f907dcSJoerg WunschPw default options file 829d6f907dcSJoerg Wunsch.El 830d6f907dcSJoerg Wunsch.Sh SEE ALSO 831d6f907dcSJoerg Wunsch.Xr chpass 1 , 832053375e8SMike Pritchard.Xr passwd 1 , 833d6f907dcSJoerg Wunsch.Xr group 5 , 834bfd34a4aSWolfram Schneider.Xr login.conf 5 , 835053375e8SMike Pritchard.Xr passwd 5 , 836053375e8SMike Pritchard.Xr pw.conf 5 , 837d6f907dcSJoerg Wunsch.Xr pwd_mkdb 8 , 838053375e8SMike Pritchard.Xr vipw 8 839d6f907dcSJoerg Wunsch.Sh HISTORY 8401dcc6ec7SPhilippe Charnier.Nm Pw 8419fd0dafcSJoerg Wunschwas written to mimic many of the options used in the SYSV 842d6f907dcSJoerg Wunsch.Em shadow 8439fd0dafcSJoerg Wunschsupport suite, but is modified for passwd and group fields specific to 844053375e8SMike Pritchardthe 845053375e8SMike Pritchard.Bx 4.4 8469fd0dafcSJoerg Wunschoperating system, and combines all of the major elements 8479fd0dafcSJoerg Wunschinto a single command. 848