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