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