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