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.14 1996/12/23 00:10:16 mpp Exp $
31 .Nd command for adding new users
36 .Op Ar group Ns , Ns Op Ar group,...
42 .Op Fl dotdir Ar dotdir
43 .Op Fl group Ar login_group
46 .Op Fl message Ar message_file
49 .Op Fl s | silent | q | quiet
50 .Op Fl uid Ar uid_start
54 is a simple program for adding new users. Adduser checks
55 the passwd, group and shell databases. It creates passwd/group entries,
56 HOME-directory, dotfiles and sends the new user a welcome message.
58 .Bl -tag -width Ds -compact
60 Login name. May contain only lowercase characters or digits. Maximum length
64 The reasons for this limit are "Historical".
65 Given that people have traditionally wanted to break this
66 limit for aesthetic reasons, it's never been of great importance to break
67 such a basic fundamental parameter in UNIX.
71 .Pa /usr/include/utmp.h
73 world; people have done this and it works, but you will have problems
74 with any precompiled programs, or source that assumes the 8-character
75 name limit and NIS. The NIS protocol mandates an 8-character username.
76 If you need a longer login name for e-mail addresses,
77 you can define an alias in
80 Firstname and surname.
83 character is not allowed.
85 Only valid shells from the shell database or sliplogin and pppd
87 Automatically generated or your choice, must be less than 32000.
88 .It Sy gid/login group
89 Your choice or automatically generated.
91 If not empty, password is encoded with
95 Perhaps you're missing what
97 be done with this scheme that falls apart
98 with most other schemes. With each user in his/her own group the user can
99 safely run with a umask of 002 and have files created in their home directory
100 and not worry about others being able to read them.
102 For a shared area you create a separate uid/gid (like cvs or ncvs on freefall),
103 you place each person that should be able to access this area into that new
106 This model of uid/gid administration allows far greater flexibility than lumping
107 users into groups and having to muck with the umask when working in a shared
110 I have been using this model for almost 10 years and found that it works
111 for most situations, and has never gotten in the way. (Rod Grimes)
113 .Bl -tag -width Ds -compact
115 Read intern variables.
117 Read config file (/etc/adduser.conf)
119 Parse command line options
123 .It Sy -batch username [group[,group]...] [fullname] [password]
126 Check /etc/passwd, /etc/group, /etc/shells and exit.
127 .It Sy -create_config
128 Create new config and message file and exit.
129 .It Sy -dotdir Ar directory
132 into the HOME-directory of new users,
138 specified is equal to
140 For security make all files writable and readable for owner,
141 don't allow group or world to write files and allow only owner
142 to read/execute/write
151 .It Sy -group Ar login_group
154 means use username as login group.
156 Print options and exit.
157 .It Sy -home Ar partition
158 Default home partition where all users located.
159 .It Sy -message Ar file
160 Send new users a welcome message.
161 Don't send message if
166 Do not read config file.
167 .It Sy -shell Ar shell
168 Default shell for new users.
169 .It Sy -silent,-s,-quiet,-q
170 Few warnings, questions, bug reports.
176 Many warnings, questions. Recommended for novice users.
178 .Bl -tag -width Ds -compact
183 reads and writes this file.
185 .Pa /etc/adduser.conf
188 Eval variables in this file. See
189 .Pa /etc/adduser.message
197 Start adduser in interactive mode.
199 $ adduser -batch baerenklau guest,staff,baer 'Teddy II' qwerty7
201 Create user 'baerenklau' and login group 'baerenklau'. Invite user
202 baerenklau into groups guest, staff and baer. Realname (fullname)
203 is 'Teddy II'. Password is 'qwerty7' (don't use such passwords!). Create
206 and copy all files and directories
210 .Pa /home/baerenklau .
214 $ adduser -uid 5000 -group guest -message no -batch vehlefanz
216 Create user 'vehlefanz'. Login group is guest. Uid next available uid
217 after 5000, for instance 5007. No other groups, no realname, no password.
218 Do not send a welcome message.
220 .Bl -tag -width /etc/master.passwdxx -compact
221 .It Pa /etc/master.passwd
227 .It Pa /etc/adduser.conf
228 config file for adduser
229 .It Pa /etc/adduser.message
230 message file for adduser
231 .It Pa /usr/share/skel
232 skeletal login directory
233 .It Pa /var/log/adduser