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