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