11f882a58SAlexander Ziaee.\"- 21f882a58SAlexander Ziaee.\" SPDX-License-Identifier: BSD-2-Clause 31f882a58SAlexander Ziaee.\" 45a80fb27SWolfram Schneider.\" Copyright (c) 1995-1996 Wolfram Schneider <wosch@FreeBSD.org>. Berlin. 55a80fb27SWolfram Schneider.\" All rights reserved. 6d07e6722SRuslan Ermilov.\" Copyright (c) 2002-2004 Michael Telahun Makonnen <mtm@FreeBSD.org> 77cdfce09SScott Long.\" All rights reserved. 88f1133e6SJordan K. Hubbard.\" 98f1133e6SJordan K. Hubbard.\" Redistribution and use in source and binary forms, with or without 108f1133e6SJordan K. Hubbard.\" modification, are permitted provided that the following conditions 118f1133e6SJordan K. Hubbard.\" are met: 128f1133e6SJordan K. Hubbard.\" 1. Redistributions of source code must retain the above copyright 138f1133e6SJordan K. Hubbard.\" notice, this list of conditions and the following disclaimer. 148f1133e6SJordan K. Hubbard.\" 2. Redistributions in binary form must reproduce the above copyright 158f1133e6SJordan K. Hubbard.\" notice, this list of conditions and the following disclaimer in the 168f1133e6SJordan K. Hubbard.\" documentation and/or other materials provided with the distribution. 178f1133e6SJordan K. Hubbard.\" 185a80fb27SWolfram Schneider.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 195a80fb27SWolfram Schneider.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 205a80fb27SWolfram Schneider.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 215a80fb27SWolfram Schneider.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 225a80fb27SWolfram Schneider.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 235a80fb27SWolfram Schneider.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 245a80fb27SWolfram Schneider.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 255a80fb27SWolfram Schneider.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 265a80fb27SWolfram Schneider.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 275a80fb27SWolfram Schneider.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 285a80fb27SWolfram Schneider.\" SUCH DAMAGE. 298f1133e6SJordan K. Hubbard.\" 30*6a7238fdSKyle Evans.Dd December 1, 2024 318f1133e6SJordan K. Hubbard.Dt ADDUSER 8 32a4c37c81SRuslan Ermilov.Os 334298bedcSAndrey A. Chernov.Sh NAME 344298bedcSAndrey A. Chernov.Nm adduser 358f1133e6SJordan K. Hubbard.Nd command for adding new users 36f01592bbSAndrey A. Chernov.Sh SYNOPSIS 37e97407b4SRuslan Ermilov.Nm 38215c0a51SJohn Grafton.Op Fl CDENSZhq 397cdfce09SScott Long.Op Fl G Ar groups 407cdfce09SScott Long.Op Fl L Ar login_class 4143cb08ceSMike Makonnen.Op Fl M Ar mode 427cdfce09SScott Long.Op Fl d Ar partition 437cdfce09SScott Long.Op Fl f Ar file 44642a7af5SMike Makonnen.Op Fl g Ar login_group 457cdfce09SScott Long.Op Fl k Ar dotdir 467cdfce09SScott Long.Op Fl m Ar message_file 477cdfce09SScott Long.Op Fl s Ar shell 487cdfce09SScott Long.Op Fl u Ar uid_start 497cdfce09SScott Long.Op Fl w Ar type 504298bedcSAndrey A. Chernov.Sh DESCRIPTION 51490d5836SPhilippe CharnierThe 52829629feSRuslan Ermilov.Nm 53829629feSRuslan Ermilovutility is a shell script, implemented around the 547cdfce09SScott Long.Xr pw 8 557cdfce09SScott Longcommand, for adding new users. 567cdfce09SScott LongIt creates passwd/group entries, a home directory, 577cdfce09SScott Longcopies dotfiles and sends the new user a welcome message. 58215c0a51SJohn GraftonOn systems where the parent of home directory is a ZFS dataset, 59215c0a51SJohn Grafton.Nm 60215c0a51SJohn Graftonwill create the home directory as a ZFS dataset by default, 61215c0a51SJohn Graftonunless the system administrator specified otherwise. 62829629feSRuslan ErmilovIt supports two modes of operation. 63829629feSRuslan ErmilovIt may be used interactively 64829629feSRuslan Ermilovat the command line to add one user at a time, or it may be directed 657cdfce09SScott Longto get the list of new users from a file and operate in batch mode 667cdfce09SScott Longwithout requiring any user interaction. 67574d7dc0SMike Pritchard.Sh RESTRICTIONS 68829629feSRuslan Ermilov.Bl -tag -width indent 69829629feSRuslan Ermilov.It username 702ed2dc52SSheldon HearnLogin name. 717cdfce09SScott LongThe user name is restricted to whatever 727cdfce09SScott Long.Xr pw 8 73829629feSRuslan Ermilovwill accept. 74829629feSRuslan ErmilovGenerally this means it 75bc84aa4bSRuslan Ermilovmay contain only lowercase characters or digits but cannot begin with the 76bc84aa4bSRuslan Ermilov.Ql - 7715b2a87fSTom Rhodescharacter. 78f2e366a1SSheldon HearnMaximum length 797cdfce09SScott Longis 16 characters. 80829629feSRuslan ErmilovThe reasons for this limit are historical. 81b86759fdSWolfram SchneiderGiven that people have traditionally wanted to break this 82829629feSRuslan Ermilovlimit for aesthetic reasons, it has never been of great importance to break 83829629feSRuslan Ermilovsuch a basic fundamental parameter in 84829629feSRuslan Ermilov.Ux . 85574d7dc0SMike PritchardYou can change 86574d7dc0SMike Pritchard.Dv UT_NAMESIZE 87574d7dc0SMike Pritchardin 88743d5d51SRuslan Ermilov.In utmp.h 89574d7dc0SMike Pritchardand recompile the 90b86759fdSWolfram Schneiderworld; people have done this and it works, but you will have problems 91b86759fdSWolfram Schneiderwith any precompiled programs, or source that assumes the 8-character 9215b2a87fSTom Rhodesname limit, such as NIS. 93f2e366a1SSheldon HearnThe NIS protocol mandates an 8-character username. 94b86759fdSWolfram SchneiderIf you need a longer login name for e-mail addresses, 95b86759fdSWolfram Schneideryou can define an alias in 962216e2a2SGregory Neil Shapiro.Pa /etc/mail/aliases . 97829629feSRuslan Ermilov.It "full name" 987cdfce09SScott LongThis is typically known as the gecos field and usually contains 99829629feSRuslan Ermilovthe user's full name. 100829629feSRuslan ErmilovAdditionally, it may contain a comma separated 101829629feSRuslan Ermilovlist of values such as office number and work and home phones. 102829629feSRuslan ErmilovIf the 10357bd0fc6SJens Schweikhardtname contains an ampersand it will be replaced by the capitalized 1047cdfce09SScott Longlogin name when displayed by other programs. 105574d7dc0SMike PritchardThe 106829629feSRuslan Ermilov.Ql \&: 107574d7dc0SMike Pritchardcharacter is not allowed. 108829629feSRuslan Ermilov.It shell 109e7291a6bSMike MakonnenUnless the 110e7291a6bSMike Makonnen.Fl S 111e7291a6bSMike Makonnenargument is supplied only valid shells from the shell database 112829629feSRuslan Ermilov.Pq Pa /etc/shells 113829629feSRuslan Ermilovare allowed. 114e7291a6bSMike MakonnenIn addition, 115e7291a6bSMike Makonneneither the base name or the full path of the shell may be supplied. 116829629feSRuslan Ermilov.It UID 117829629feSRuslan ErmilovAutomatically generated or your choice. 118829629feSRuslan ErmilovIt must be less than 32000. 119829629feSRuslan Ermilov.It "GID/login group" 120829629feSRuslan ErmilovAutomatically generated or your choice. 121829629feSRuslan ErmilovIt must be less than 32000. 122829629feSRuslan Ermilov.It password 1237cdfce09SScott LongYou may choose an empty password, disable the password, use a 1247cdfce09SScott Longrandomly generated password or specify your own plaintext password, 1257cdfce09SScott Longwhich will be encrypted before being stored in the user database. 1268f1133e6SJordan K. Hubbard.El 127574d7dc0SMike Pritchard.Sh UNIQUE GROUPS 128829629feSRuslan ErmilovPerhaps you are missing what 129574d7dc0SMike Pritchard.Em can 130574d7dc0SMike Pritchardbe done with this scheme that falls apart 13178c26653STony Finchwith most other schemes. 1323967e18aSTony FinchWith each user in their own group, 1333967e18aSTony Finchthey can safely run with a umask of 002 instead of the usual 022 13478c26653STony Finchand create files in their home directory 13578c26653STony Finchwithout worrying about others being able to change them. 136574d7dc0SMike Pritchard.Pp 1376b63b7b7SIsabell LongFor a shared area you create a separate UID/GID, you place each person 1386b63b7b7SIsabell Longthat should be able to access this area into that new group. 139574d7dc0SMike Pritchard.Pp 140829629feSRuslan ErmilovThis model of UID/GID administration allows far greater flexibility than lumping 141f01592bbSAndrey A. Chernovusers into groups and having to muck with the umask when working in a shared 142f01592bbSAndrey A. Chernovarea. 143574d7dc0SMike Pritchard.Pp 144f01592bbSAndrey A. ChernovI have been using this model for almost 10 years and found that it works 145829629feSRuslan Ermilovfor most situations, and has never gotten in the way. 146829629feSRuslan Ermilov(Rod Grimes) 1478f1133e6SJordan K. Hubbard.Sh CONFIGURATION 1487cdfce09SScott LongThe 1497cdfce09SScott Long.Nm 1507cdfce09SScott Longutility reads its configuration information from 151829629feSRuslan Ermilov.Pa /etc/adduser.conf . 152829629feSRuslan ErmilovIf this file does not exist, it will use predefined defaults. 153829629feSRuslan ErmilovWhile this file may be edited by hand, 154829629feSRuslan Ermilovthe safer option is to use the 155829629feSRuslan Ermilov.Fl C 156829629feSRuslan Ermilovcommand line argument. 157829629feSRuslan ErmilovWith this argument, 1587cdfce09SScott Long.Nm 1597cdfce09SScott Longwill start interactive input, save the answers to its prompts in 160829629feSRuslan Ermilov.Pa /etc/adduser.conf , 1617cdfce09SScott Longand promptly exit without modifying the user 162829629feSRuslan Ermilovdatabase. 163829629feSRuslan ErmilovOptions specified on the command line will take precedence over 1647cdfce09SScott Longany values saved in this file. 1658f1133e6SJordan K. Hubbard.Sh OPTIONS 166829629feSRuslan Ermilov.Bl -tag -width indent 1677cdfce09SScott Long.It Fl C 168829629feSRuslan ErmilovCreate new configuration file and exit. 169829629feSRuslan ErmilovThis option is mutually exclusive with the 170829629feSRuslan Ermilov.Fl f 1717cdfce09SScott Longoption. 1727cdfce09SScott Long.It Fl d Ar partition 173829629feSRuslan ErmilovHome partition. 174829629feSRuslan ErmilovDefault partition, under which all user directories 1757cdfce09SScott Longwill be located. 1760d640c0dSMike MakonnenThe 177d07e6722SRuslan Ermilov.Pa /nonexistent 1780d640c0dSMike Makonnenpartition is considered special. 1790d640c0dSMike MakonnenThe 1800d640c0dSMike Makonnen.Nm 1810d640c0dSMike Makonnenscript will not create and populate a home directory by that name. 1820d640c0dSMike MakonnenOtherwise, 1830d640c0dSMike Makonnenby default it attempts to create a home directory. 1840d640c0dSMike Makonnen.It Fl D 1850d640c0dSMike MakonnenDo not attempt to create the home directory. 1867cdfce09SScott Long.It Fl E 187829629feSRuslan ErmilovDisable the account. 188829629feSRuslan ErmilovThis option will lock the account by prepending the string 189829629feSRuslan Ermilov.Dq Li *LOCKED* 190829629feSRuslan Ermilovto the password field. 191829629feSRuslan ErmilovThe account may be unlocked 1927cdfce09SScott Longby the super-user with the 1937cdfce09SScott Long.Xr pw 8 1947cdfce09SScott Longcommand: 1957cdfce09SScott Long.Pp 196829629feSRuslan Ermilov.D1 Nm pw Cm unlock Op Ar name | uid 1977cdfce09SScott Long.It Fl f Ar file 1987cdfce09SScott LongGet the list of accounts to create from 1997cdfce09SScott Long.Ar file . 2007cdfce09SScott LongIf 2017cdfce09SScott Long.Ar file 202829629feSRuslan Ermilovis 203829629feSRuslan Ermilov.Dq Fl , 204829629feSRuslan Ermilovthen get the list from standard input. 205829629feSRuslan ErmilovIf this option is specified, 2067cdfce09SScott Long.Nm 207829629feSRuslan Ermilovwill operate in batch mode and will not seek any user input. 208829629feSRuslan ErmilovIf an error is encountered while processing an account, it will write a 209829629feSRuslan Ermilovmessage to standard error and move to the next account. 210829629feSRuslan ErmilovThe format 2117cdfce09SScott Longof the input file is described below. 212642a7af5SMike Makonnen.It Fl g Ar login_group 213b3bd9a17SCeri DaviesNormally, 214642a7af5SMike Makonnenif no login group is specified, 215642a7af5SMike Makonnenit is assumed to be the same as the username. 216642a7af5SMike MakonnenThis option makes 217642a7af5SMike Makonnen.Ar login_group 218642a7af5SMike Makonnenthe default. 2197cdfce09SScott Long.It Fl G Ar groups 22088b63febSMike MakonnenSpace-separated list of additional groups. 2217cdfce09SScott LongThis option allows the user to specify additional groups to add users to. 222642a7af5SMike MakonnenThe user is a member of these groups in addition to their login group. 2237cdfce09SScott Long.It Fl h 2247cdfce09SScott LongPrint a summary of options and exit. 2257cdfce09SScott Long.It Fl k Ar directory 226f01592bbSAndrey A. ChernovCopy files from 227f01592bbSAndrey A. Chernov.Ar directory 2287cdfce09SScott Longinto the home 229829629feSRuslan Ermilovdirectory of new users; 230829629feSRuslan Ermilov.Pa dot.foo 231b8594fe0SPhilippe Charnierwill be renamed to 232829629feSRuslan Ermilov.Pa .foo . 2337cdfce09SScott Long.It Fl L Ar login_class 2347cdfce09SScott LongSet default login class. 2357cdfce09SScott Long.It Fl m Ar file 236b8594fe0SPhilippe CharnierSend new users a welcome message from 237b8594fe0SPhilippe Charnier.Ar file . 238b8594fe0SPhilippe CharnierSpecifying a value of 239829629feSRuslan Ermilov.Cm no 240b8594fe0SPhilippe Charnierfor 2418f1133e6SJordan K. Hubbard.Ar file 242829629feSRuslan Ermilovcauses no message to be sent to new users. 243829629feSRuslan ErmilovPlease note that the message 2447cdfce09SScott Longfile can reference the internal variables of the 2457cdfce09SScott Long.Nm 2467cdfce09SScott Longscript. 24743cb08ceSMike Makonnen.It Fl M Ar mode 24843cb08ceSMike MakonnenCreate the home directory with permissions set to 249*6a7238fdSKyle Evans.Ar mode , 250*6a7238fdSKyle Evansmodified by the current 251*6a7238fdSKyle Evans.Xr umask 2 . 2527cdfce09SScott Long.It Fl N 253b8594fe0SPhilippe CharnierDo not read the default configuration file. 2547cdfce09SScott Long.It Fl q 255829629feSRuslan ErmilovMinimal user feedback. 256829629feSRuslan ErmilovIn particular, the random password will not be echoed to 2577cdfce09SScott Longstandard output. 2587cdfce09SScott Long.It Fl s Ar shell 259829629feSRuslan ErmilovDefault shell for new users. 260829629feSRuslan ErmilovThe 2617cdfce09SScott Long.Ar shell 262e7291a6bSMike Makonnenargument may be the base name of the shell or the full path. 263e7291a6bSMike MakonnenUnless the 264e7291a6bSMike Makonnen.Fl S 265e7291a6bSMike Makonnenargument is supplied the shell must exist in 266829629feSRuslan Ermilov.Pa /etc/shells 2678923e98bSMike Makonnenor be the special shell 2688923e98bSMike Makonnen.Em nologin 2697cdfce09SScott Longto be considered a valid shell. 2700d640c0dSMike Makonnen.It Fl S 2710d640c0dSMike MakonnenThe existence or validity of the specified shell will not be checked. 2727cdfce09SScott Long.It Fl u Ar uid 273829629feSRuslan ErmilovUse UIDs from 274f01592bbSAndrey A. Chernov.Ar uid 275574d7dc0SMike Pritchardon up. 2767cdfce09SScott Long.It Fl w Ar type 277829629feSRuslan ErmilovPassword type. 278829629feSRuslan ErmilovThe 279490d5836SPhilippe Charnier.Nm 2807cdfce09SScott Longutility allows the user to specify what type of password to create. 2817cdfce09SScott LongThe 2827cdfce09SScott Long.Ar type 2837cdfce09SScott Longargument may have one of the following values: 284829629feSRuslan Ermilov.Bl -tag -width ".Cm random" 285829629feSRuslan Ermilov.It Cm no 286829629feSRuslan ErmilovDisable the password. 28757bd0fc6SJens SchweikhardtInstead of an encrypted string, the password field will contain a single 288829629feSRuslan Ermilov.Ql * 289829629feSRuslan Ermilovcharacter. 2907cdfce09SScott LongThe user may not log in until the super-user 2917cdfce09SScott Longmanually enables the password. 292829629feSRuslan Ermilov.It Cm none 2937cdfce09SScott LongUse an empty string as the password. 294829629feSRuslan Ermilov.It Cm yes 295829629feSRuslan ErmilovUse a user-supplied string as the password. 296829629feSRuslan ErmilovIn interactive mode, 297829629feSRuslan Ermilovthe user will be prompted for the password. 298829629feSRuslan ErmilovIn batch mode, the 2997cdfce09SScott Longlast (10th) field in the line is assumed to be the password. 300829629feSRuslan Ermilov.It Cm random 301829629feSRuslan ErmilovGenerate a random string and use it as a password. 302829629feSRuslan ErmilovThe password will be echoed to standard output. 303829629feSRuslan ErmilovIn addition, it will be available for inclusion in the message file in the 304829629feSRuslan Ermilov.Va randompass 305829629feSRuslan Ermilovvariable. 306829629feSRuslan Ermilov.El 307215c0a51SJohn Grafton.It Fl Z 308215c0a51SJohn GraftonDo not attempt to create ZFS home dataset. 3097cdfce09SScott Long.El 3107cdfce09SScott Long.Sh FORMAT 3117cdfce09SScott LongWhen the 312829629feSRuslan Ermilov.Fl f 313829629feSRuslan Ermilovoption is used, the account information must be stored in a specific 314829629feSRuslan Ermilovformat. 315829629feSRuslan ErmilovAll empty lines or lines beginning with a 316829629feSRuslan Ermilov.Ql # 317829629feSRuslan Ermilovwill be ignored. 318829629feSRuslan ErmilovAll other lines must contain ten colon 319829629feSRuslan Ermilov.Pq Ql \&: 320829629feSRuslan Ermilovseparated fields as described below. 321829629feSRuslan ErmilovCommand line options do not take precedence 322829629feSRuslan Ermilovover values in the fields. 323829629feSRuslan ErmilovOnly the password field may contain a 324829629feSRuslan Ermilov.Ql \&: 3257cdfce09SScott Longcharacter as part of the string. 3267cdfce09SScott Long.Pp 327829629feSRuslan Ermilov.Sm off 328829629feSRuslan Ermilov.D1 Ar name : uid : gid : class : change : expire : gecos : home_dir : shell : password 329829629feSRuslan Ermilov.Sm on 330829629feSRuslan Ermilov.Bl -tag -width ".Ar password" 331829629feSRuslan Ermilov.It Ar name 332829629feSRuslan ErmilovLogin name. 333829629feSRuslan ErmilovThis field may not be empty. 334829629feSRuslan Ermilov.It Ar uid 335829629feSRuslan ErmilovNumeric login user ID. 336829629feSRuslan ErmilovIf this field is left empty, it will be automatically generated. 337829629feSRuslan Ermilov.It Ar gid 338829629feSRuslan ErmilovNumeric primary group ID. 339829629feSRuslan ErmilovIf this field is left empty, a group with the 340829629feSRuslan Ermilovsame name as the user name will be created and its GID will be used 3417cdfce09SScott Longinstead. 342829629feSRuslan Ermilov.It Ar class 343829629feSRuslan ErmilovLogin class. 344829629feSRuslan ErmilovThis field may be left empty. 345829629feSRuslan Ermilov.It Ar change 3467cdfce09SScott LongPassword ageing. 347829629feSRuslan ErmilovThis field denotes the password change date for the account. 348829629feSRuslan ErmilovThe format of this field is the same as the format of the 349829629feSRuslan Ermilov.Fl p 3507cdfce09SScott Longargument to 3517cdfce09SScott Long.Xr pw 8 . 352829629feSRuslan ErmilovIt may be 353829629feSRuslan Ermilov.Ar dd Ns - Ns Ar mmm Ns - Ns Ar yy Ns Op Ar yy , 354829629feSRuslan Ermilovwhere 355829629feSRuslan Ermilov.Ar dd 356829629feSRuslan Ermilovis for the day, 357829629feSRuslan Ermilov.Ar mmm 358829629feSRuslan Ermilovis for the month in numeric or alphabetical format: 359829629feSRuslan Ermilov.Dq Li 10 3607cdfce09SScott Longor 361829629feSRuslan Ermilov.Dq Li Oct , 362829629feSRuslan Ermilovand 363829629feSRuslan Ermilov.Ar yy Ns Op Ar yy 364829629feSRuslan Ermilovis the four or two digit year. 365829629feSRuslan ErmilovTo denote a time relative to the current date the format is: 366829629feSRuslan Ermilov.No + Ns Ar n Ns Op Ar mhdwoy , 367829629feSRuslan Ermilovwhere 368829629feSRuslan Ermilov.Ar n 369829629feSRuslan Ermilovdenotes a number, followed by the minutes, hours, days, weeks, 370829629feSRuslan Ermilovmonths or years after which the password must be changed. 371829629feSRuslan ErmilovThis field may be left empty to turn it off. 372829629feSRuslan Ermilov.It Ar expire 373829629feSRuslan ErmilovAccount expiration. 374829629feSRuslan ErmilovThis field denotes the expiry date of the account. 375829629feSRuslan ErmilovThe account may not be used after the specified date. 376829629feSRuslan ErmilovThe format of this field is the same as that for password ageing. 377829629feSRuslan ErmilovThis field may be left empty to turn it off. 378829629feSRuslan Ermilov.It Ar gecos 379829629feSRuslan ErmilovFull name and other extra information about the user. 380829629feSRuslan Ermilov.It Ar home_dir 381829629feSRuslan ErmilovHome directory. 382829629feSRuslan ErmilovIf this field is left empty, it will be automatically 383829629feSRuslan Ermilovcreated by appending the username to the home partition. 3840d640c0dSMike MakonnenThe 3850d640c0dSMike Makonnen.Pa /nonexistent 3860d640c0dSMike Makonnenhome directory is considered special and 3870d640c0dSMike Makonnenis understood to mean that no home directory is to be 3880d640c0dSMike Makonnencreated for the user. 389829629feSRuslan Ermilov.It Ar shell 390829629feSRuslan ErmilovLogin shell. 391e7291a6bSMike MakonnenThis field should contain either the base name or 392e7291a6bSMike Makonnenthe full path to a valid login shell. 393829629feSRuslan Ermilov.It Ar password 394829629feSRuslan ErmilovUser password. 395829629feSRuslan ErmilovThis field should contain a plaintext string, which will 396829629feSRuslan Ermilovbe encrypted before being placed in the user database. 397829629feSRuslan ErmilovIf the password type is 398829629feSRuslan Ermilov.Cm yes 399829629feSRuslan Ermilovand this field is empty, it is assumed the account will have an empty password. 400829629feSRuslan ErmilovIf the password type is 401829629feSRuslan Ermilov.Cm random 402829629feSRuslan Ermilovand this field is 403829629feSRuslan Ermilov.Em not 404829629feSRuslan Ermilovempty, its contents will be used 405829629feSRuslan Ermilovas a password. 406829629feSRuslan ErmilovThis field will be ignored if the 407eb95fd33SChristian Brueffer.Fl w 408829629feSRuslan Ermilovoption is used with a 409829629feSRuslan Ermilov.Cm no 410829629feSRuslan Ermilovor 411829629feSRuslan Ermilov.Cm none 412829629feSRuslan Ermilovargument. 41357bd0fc6SJens SchweikhardtBe careful not to terminate this field with a closing 414829629feSRuslan Ermilov.Ql \&: 415829629feSRuslan Ermilovbecause it will be treated as part of the password. 4168f1133e6SJordan K. Hubbard.El 4174298bedcSAndrey A. Chernov.Sh FILES 418829629feSRuslan Ermilov.Bl -tag -width ".Pa /etc/adduser.message" -compact 4198f1133e6SJordan K. Hubbard.It Pa /etc/master.passwd 4208f1133e6SJordan K. Hubbarduser database 4218f1133e6SJordan K. Hubbard.It Pa /etc/group 4228f1133e6SJordan K. Hubbardgroup database 4238f1133e6SJordan K. Hubbard.It Pa /etc/shells 4248f1133e6SJordan K. Hubbardshell database 42584dc96f1SAndrey A. Chernov.It Pa /etc/login.conf 42684dc96f1SAndrey A. Chernovlogin classes database 4278f1133e6SJordan K. Hubbard.It Pa /etc/adduser.conf 428829629feSRuslan Ermilovconfiguration file for 429829629feSRuslan Ermilov.Nm 4308f1133e6SJordan K. Hubbard.It Pa /etc/adduser.message 431829629feSRuslan Ermilovmessage file for 432829629feSRuslan Ermilov.Nm 4338f1133e6SJordan K. Hubbard.It Pa /usr/share/skel 4348f1133e6SJordan K. Hubbardskeletal login directory 4351f882a58SAlexander Ziaee.It Pa /var/log/userlog 436829629feSRuslan Ermilovlogfile for 437829629feSRuslan Ermilov.Nm 4388f1133e6SJordan K. Hubbard.El 4394298bedcSAndrey A. Chernov.Sh SEE ALSO 4408f1133e6SJordan K. Hubbard.Xr chpass 1 , 4418f1133e6SJordan K. Hubbard.Xr passwd 1 , 44200de0ec3STom Rhodes.Xr adduser.conf 5 , 4438f1133e6SJordan K. Hubbard.Xr aliases 5 , 4448f1133e6SJordan K. Hubbard.Xr group 5 , 44584dc96f1SAndrey A. Chernov.Xr login.conf 5 , 446bfd34a4aSWolfram Schneider.Xr passwd 5 , 4478f1133e6SJordan K. Hubbard.Xr shells 5 , 44810e41acaSWolfram Schneider.Xr pw 8 , 4498f1133e6SJordan K. Hubbard.Xr pwd_mkdb 8 , 450901c028eSWolfram Schneider.Xr rmuser 8 , 451491a8429SRuslan Ermilov.Xr vipw 8 , 452491a8429SRuslan Ermilov.Xr yp 8 4534298bedcSAndrey A. Chernov.Sh HISTORY 4548f1133e6SJordan K. HubbardThe 4558f1133e6SJordan K. Hubbard.Nm 4567cdfce09SScott Longcommand appeared in 45785cf659aSMike Pritchard.Fx 2.1 . 4587cdfce09SScott Long.Sh AUTHORS 459829629feSRuslan Ermilov.An -nosplit 460829629feSRuslan ErmilovThis manual page and the original script, in Perl, was written by 46101c2b8acSBaptiste Daroussin.An Wolfram Schneider Aq Mt wosch@FreeBSD.org . 462829629feSRuslan ErmilovThe replacement script, written as a Bourne 4637cdfce09SScott Longshell script with some enhancements, and the man page modification that 4647cdfce09SScott Longcame with it were done by 46501c2b8acSBaptiste Daroussin.An Mike Makonnen Aq Mt mtm@identd.net . 4667cdfce09SScott Long.Sh BUGS 4677cdfce09SScott LongIn order for 4687cdfce09SScott Long.Nm 469829629feSRuslan Ermilovto correctly expand variables such as 470829629feSRuslan Ermilov.Va $username 471829629feSRuslan Ermilovand 472829629feSRuslan Ermilov.Va $randompass 473829629feSRuslan Ermilovin the message sent to new users, it must let the shell evaluate 474829629feSRuslan Ermiloveach line of the message file. 475829629feSRuslan ErmilovThis means that shell commands can also be embedded in the message file. 476829629feSRuslan ErmilovThe 4777cdfce09SScott Long.Nm 47857bd0fc6SJens Schweikhardtutility attempts to mitigate the possibility of an attacker using this 479b3bd9a17SCeri Daviesfeature by refusing to evaluate the file if it is not owned and writable 480829629feSRuslan Ermilovonly by the root user. 481829629feSRuslan ErmilovIn addition, shell special characters and operators will have to be 482829629feSRuslan Ermilovescaped when used in the message file. 4837cdfce09SScott Long.Pp 4843f61998eSCeri DaviesAlso, password ageing and account expiry times are currently settable 48500de0ec3STom Rhodesonly in batch mode or when specified in 48600de0ec3STom Rhodes.Pa /etc/adduser.conf . 4877cdfce09SScott LongThe user should be able to set them in interactive mode as well. 488