1 .\" Copyright (c) 1995-1996 Wolfram Schneider <wosch@FreeBSD.org>. Berlin.
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
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.
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
25 .\" $Id: adduser.8,v 1.24 1998/02/14 22:55:23 steve Exp $
32 .Nd command for adding new users
37 .Op Ar group Ns , Ns Op Ar group,...
45 .Op Fl class Ar login_class
49 .Op Fl dotdir Ar dotdir
51 .Op Fl group Ar login_group
57 .Op Fl message Ar message_file
63 .Op Fl s | silent | q | quiet
65 .Op Fl uid Ar uid_start
70 is a simple program for adding new users. Adduser checks
71 the passwd, group and shell databases. It creates passwd/group entries,
73 directory, dotfiles and sends the new user a welcome message.
75 .Bl -tag -width Ds -compact
77 Login name. May contain only lowercase characters or digits. Maximum length
81 The reasons for this limit are "Historical".
82 Given that people have traditionally wanted to break this
83 limit for aesthetic reasons, it's never been of great importance to break
84 such a basic fundamental parameter in UNIX.
88 .Pa /usr/include/utmp.h
90 world; people have done this and it works, but you will have problems
91 with any precompiled programs, or source that assumes the 8-character
92 name limit and NIS. The NIS protocol mandates an 8-character username.
93 If you need a longer login name for e-mail addresses,
94 you can define an alias in
97 Firstname and surname.
100 character is not allowed.
102 Only valid shells from the shell database or sliplogin and pppd
104 Automatically generated or your choice, must be less than 32000.
105 .It Sy gid/login group
106 Your choice or automatically generated.
108 If not empty, password is encoded with
112 Perhaps you're missing what
114 be done with this scheme that falls apart
115 with most other schemes. With each user in his/her own group the user can
116 safely run with a umask of 002 and have files created in their home directory
117 and not worry about others being able to read them.
119 For a shared area you create a separate uid/gid (like cvs or ncvs on freefall),
120 you place each person that should be able to access this area into that new
123 This model of uid/gid administration allows far greater flexibility than lumping
124 users into groups and having to muck with the umask when working in a shared
127 I have been using this model for almost 10 years and found that it works
128 for most situations, and has never gotten in the way. (Rod Grimes)
132 Read internal variables.
134 Read configuration file (/etc/adduser.conf).
136 Parse command line options.
140 .It Sy -batch username [group[,group]...] [class] [fullname] [password]
142 The listed groups are secondary groups that the new user should be a
143 member of in addition to the default login group. Null string arguments
144 may be used as place holders and result in the default value for the
145 nulled field being used.
147 Check /etc/passwd, /etc/group, /etc/shells and exit.
148 .It Sy -class Ar login_class
149 Set default login class.
150 .It Sy -config_create
151 Create new configuration and message file and exit.
152 .It Sy -dotdir Ar directory
157 directory of new users,
163 specified is equal to
165 For security make all files writable and readable for owner,
166 don't allow group or world to write files and allow only owner
167 to read/execute/write
176 .It Sy -group Ar login_group
179 means that the username is to be used as login group.
181 Print a summary of options and exit.
182 .It Sy -home Ar partition
183 Default home partition where all users located.
184 .It Sy -message Ar file
185 Send new users a welcome message from
187 Specifying a value of
191 causes no message to be sent to new users.
193 Do not read the default configuration file.
194 .It Sy -shell Ar shell
195 Default shell for new users.
196 .It Sy -silent,-s,-quiet,-q
197 Few warnings, questions, bug reports.
203 Many warnings, questions. Recommended for novice users.
205 .Bl -tag -width Ds -compact
208 .It Sy configuration file
210 reads and writes this file.
212 .Pa /etc/adduser.conf
215 Eval variables in this file. See
216 .Pa /etc/adduser.message
224 Start adduser in interactive mode.
226 $ adduser -batch baerenklau guest,staff,baer '' 'Teddy II' qwerty7
228 Create user 'baerenklau' and login group 'baerenklau'. Invite user
229 baerenklau into groups guest, staff and baer. Use default login class.
231 is 'Teddy II'. Password is 'qwerty7' (don't use such passwords!). Create
235 and copy all files and directories
239 .Pa /home/baerenklau .
243 $ adduser -uid 5000 -group guest -message no -batch vehlefanz
245 Create user 'vehlefanz'. Login group is guest. Uid next available uid
246 after 5000, for instance 5007. No other groups, no realname, no password.
247 Do not send a welcome message.
249 .Bl -tag -width /etc/master.passwdxx -compact
250 .It Pa /etc/master.passwd
256 .It Pa /etc/login.conf
257 login classes database
258 .It Pa /etc/adduser.conf
259 configuration file for adduser
260 .It Pa /etc/adduser.message
261 message file for adduser
262 .It Pa /usr/share/skel
263 skeletal login directory
264 .It Pa /var/log/adduser