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