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