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