1.\" Copyright (c) 1995-1996 Wolfram Schneider <wosch@FreeBSD.org>. Berlin. 2.\" 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 THE AUTHOR 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 THE AUTHOR 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 January 9, 1995 28.Dt ADDUSER 8 29.Os 30.Sh NAME 31.Nm adduser 32.Nd command for adding new users 33.Sh SYNOPSIS 34.Nm 35.Bk -words 36.Op Fl check_only 37.Op Fl class Ar login_class 38.Op Fl config_create 39.Op Fl dotdir Ar dotdir 40.Op Fl group Ar login_group 41.Op Fl h | help 42.Op Fl home Ar home 43.Op Fl message Ar message_file 44.Op Fl noconfig 45.Op Fl shell Ar shell 46.Op Fl s | silent | q | quiet 47.Op Fl uid Ar uid_start 48.Op Fl v | verbose 49.Ek 50.Sh DESCRIPTION 51.Nm Adduser 52is a simple program for adding new users. 53Adduser checks 54the passwd, group and shell databases. 55It creates passwd/group entries, 56.Ev HOME 57directory, dotfiles and sends the new user a welcome message. 58.Sh RESTRICTIONS 59.Bl -tag -width Ds -compact 60.It Sy username 61Login name. 62May contain only lowercase characters or digits. 63Maximum length 64is 16 characters (see 65.Xr setlogin 2 66BUGS section). 67The reasons for this limit are "Historical". 68Given that people have traditionally wanted to break this 69limit for aesthetic reasons, it's never been of great importance to break 70such a basic fundamental parameter in UNIX. 71You can change 72.Dv UT_NAMESIZE 73in 74.Pa /usr/include/utmp.h 75and recompile the 76world; people have done this and it works, but you will have problems 77with any precompiled programs, or source that assumes the 8-character 78name limit and NIS. 79The NIS protocol mandates an 8-character username. 80If you need a longer login name for e-mail addresses, 81you can define an alias in 82.Pa /etc/mail/aliases . 83.It Sy fullname 84Firstname and surname. 85The 86.Ql Pa \&: 87character is not allowed. 88.It Sy shell 89Only valid shells from the shell database or sliplogin and pppd 90.It Sy uid 91Automatically generated or your choice, must be less than 32000. 92.It Sy gid/login group 93Your choice or automatically generated. 94.It Sy password 95If not empty, password is encoded with 96.Xr crypt 3 . 97.El 98.Sh UNIQUE GROUPS 99Perhaps you're missing what 100.Em can 101be done with this scheme that falls apart 102with most other schemes. With each user in his/her own group the user can 103safely run with a umask of 002 and have files created in their home directory 104and not worry about others being able to read them. 105.Pp 106For a shared area you create a separate uid/gid (like cvs or ncvs on freefall), 107you place each person that should be able to access this area into that new 108group. 109.Pp 110This model of uid/gid administration allows far greater flexibility than lumping 111users into groups and having to muck with the umask when working in a shared 112area. 113.Pp 114I have been using this model for almost 10 years and found that it works 115for most situations, and has never gotten in the way. (Rod Grimes) 116.Sh CONFIGURATION 117.Bl -enum 118.It 119Read internal variables. 120.It 121Read configuration file (/etc/adduser.conf). 122.It 123Parse command line options. 124.El 125.Sh OPTIONS 126.Bl -tag -width Ds 127.It Fl check_only 128Check /etc/passwd, /etc/group, /etc/shells and exit. 129.It Fl class Ar login_class 130Set default login class. 131.It Fl config_create 132Create new configuration and message file and exit. 133.It Fl dotdir Ar directory 134Copy files from 135.Ar directory 136into the 137.Ev HOME 138directory of new users, 139.Ql Pa dot.foo 140will be renamed to 141.Ql Pa .foo . 142Don't copy files if 143.Ar directory 144specified is equal to 145.Ar no . 146For security make all files writable and readable for owner, 147don't allow group or world to write files and allow only owner 148to read/execute/write 149.Pa .rhost , 150.Pa .Xauthority , 151.Pa .kermrc , 152.Pa .netrc , 153.Pa Mail , 154.Pa prv , 155.Pa iscreen , 156.Pa term . 157.It Fl group Ar login_group 158Login group. 159.Ar USER 160means that the username is to be used as login group. 161.It Fl help , h , \&? 162Print a summary of options and exit. 163.It Fl home Ar partition 164Default home partition where all users located. 165.It Fl message Ar file 166Send new users a welcome message from 167.Ar file . 168Specifying a value of 169.Ar no 170for 171.Ar file 172causes no message to be sent to new users. 173.It Fl noconfig 174Do not read the default configuration file. 175.It Fl shell Ar shell 176Default shell for new users. 177.It Fl silent , s , quiet , q 178Few warnings, questions, bug reports. 179.It Fl uid Ar uid 180Use uid's from 181.Ar uid 182on up. 183.It Fl verbose , v 184Many warnings, questions. 185Recommended for novice users. 186.El 187.Sh FORMATS 188.Bl -tag -width Ds -compact 189.Ql Pa # 190is a comment. 191.It Sy configuration file 192.Nm Adduser 193reads and writes this file. 194See 195.Pa /etc/adduser.conf 196for more details. 197.It Sy message file 198Eval variables in this file. 199See 200.Pa /etc/adduser.message 201for more 202details. 203.El 204.Sh FILES 205.Bl -tag -width /etc/master.passwdxx -compact 206.It Pa /etc/master.passwd 207user database 208.It Pa /etc/group 209group database 210.It Pa /etc/shells 211shell database 212.It Pa /etc/login.conf 213login classes database 214.It Pa /etc/adduser.conf 215configuration file for adduser 216.It Pa /etc/adduser.message 217message file for adduser 218.It Pa /usr/share/skel 219skeletal login directory 220.It Pa /var/log/adduser 221logfile for adduser 222.El 223.Sh SEE ALSO 224.Xr chpass 1 , 225.Xr finger 1 , 226.Xr passwd 1 , 227.Xr setlogin 2 , 228.Xr yp 4 , 229.Xr aliases 5 , 230.Xr group 5 , 231.Xr login.conf 5 , 232.Xr passwd 5 , 233.Xr shells 5 , 234.Xr pw 8 , 235.Xr pwd_mkdb 8 , 236.Xr rmuser 8 , 237.Xr vipw 8 238.\" .Sh BUGS 239.Sh HISTORY 240The 241.Nm 242command appeared in 243.Fx 2.1 . 244