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