1996-08-27 20:04:45 +00:00
|
|
|
.\" Copyright (c) 1995-1996 Wolfram Schneider <wosch@FreeBSD.org>. Berlin.
|
|
|
|
.\" All rights reserved.
|
1995-01-09 11:26:31 +00:00
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\"
|
1996-08-27 20:04:45 +00:00
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
.\" SUCH DAMAGE.
|
1995-01-09 11:26:31 +00:00
|
|
|
.\"
|
1996-08-28 17:54:14 +00:00
|
|
|
.\" $Id: adduser.8,v 1.11 1996/08/27 20:04:33 wosch Exp $
|
1994-12-30 12:03:48 +00:00
|
|
|
|
1995-01-09 11:26:31 +00:00
|
|
|
.Dd Jan, 9, 1995
|
|
|
|
.Dt ADDUSER 8
|
|
|
|
.Os FreeBSD 2.1
|
1994-12-30 12:03:48 +00:00
|
|
|
.Sh NAME
|
|
|
|
.Nm adduser
|
1995-01-09 11:26:31 +00:00
|
|
|
.Nd command for adding new users
|
1994-12-30 12:03:48 +00:00
|
|
|
|
1995-03-08 22:44:37 +00:00
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Nm adduser
|
|
|
|
[-batch username [group[,group]...] [fullname] [password]]
|
|
|
|
[-check_only] [-config_create] [-dotdir dotdir]
|
|
|
|
[-group login_group] [-h|-help] [-home home]
|
|
|
|
[-message message_file] [-noconfig] [-shell shell]
|
|
|
|
[-s|-silent|-q|-quit] [-uid uid_start] [-v|-verbose]
|
|
|
|
|
|
|
|
|
1994-12-30 12:03:48 +00:00
|
|
|
.Sh DESCRIPTION
|
1995-01-09 11:26:31 +00:00
|
|
|
.Nm Adduser
|
1996-08-28 17:54:14 +00:00
|
|
|
is a simple program for adding new users. Adduser checks
|
|
|
|
passwd, group and shell database. It creates passwd/group entry,
|
|
|
|
HOME-directory, dotfiles and sends new user a welcome message.
|
1995-01-09 11:26:31 +00:00
|
|
|
|
1995-03-08 22:44:37 +00:00
|
|
|
.Sh RESTRICTION
|
1995-01-09 11:26:31 +00:00
|
|
|
.Bl -tag -width Ds -compact
|
|
|
|
.It Sy username
|
1996-06-09 20:45:35 +00:00
|
|
|
Login name. Only lowercase characters or digits. Maximum length
|
|
|
|
is 8 characters (see
|
|
|
|
.Xr setlogin 2
|
|
|
|
BUGS section).
|
1996-08-28 17:54:14 +00:00
|
|
|
The reasons for this limit are "Historical".
|
1996-06-09 20:45:35 +00:00
|
|
|
Given that people have traditionally wanted to break this
|
|
|
|
limit for aesthetic reasons, it's never been of great importance to break
|
|
|
|
such a basic fundamental parameter in UNIX.
|
|
|
|
You can change UT_NAMESIZE in /usr/include/utmp.h and recompile the
|
|
|
|
world; people have done this and it works, but you will have problems
|
|
|
|
with any precompiled programs, or source that assumes the 8-character
|
|
|
|
name limit and NIS. The NIS protocol mandates an 8-character username.
|
|
|
|
If you need a longer login name for e-mail addresses,
|
|
|
|
you can define an alias in
|
|
|
|
.Pa /etc/aliases .
|
1995-01-09 11:26:31 +00:00
|
|
|
.It Sy fullname
|
1995-03-08 22:44:37 +00:00
|
|
|
Firstname and surname.
|
1995-01-09 11:26:31 +00:00
|
|
|
.Ql Pa \:
|
|
|
|
not allowed.
|
|
|
|
.It Sy shell
|
1995-03-08 22:44:37 +00:00
|
|
|
Only valid shells from shell database or sliplogin and pppd
|
1995-01-09 11:26:31 +00:00
|
|
|
.It Sy uid
|
1996-08-28 17:54:14 +00:00
|
|
|
Automatically generated or your choice, less than 32000.
|
1995-03-08 22:44:37 +00:00
|
|
|
.It Sy gid/login group
|
1996-01-30 13:52:50 +00:00
|
|
|
Your choice or automatically generated.
|
1995-03-08 22:44:37 +00:00
|
|
|
.It Sy password
|
1996-08-28 17:54:14 +00:00
|
|
|
If not empty, password is encoded with crypt.
|
1995-01-09 11:26:31 +00:00
|
|
|
.El
|
|
|
|
|
1996-08-28 17:54:14 +00:00
|
|
|
.Sh UNIQUE GROUP
|
|
|
|
Perhaps you're missing what *can* be done with this scheme that falls apart
|
1995-03-08 22:44:37 +00:00
|
|
|
with most other schemes. With each user in his/her own group the user can
|
1996-08-28 17:54:14 +00:00
|
|
|
safely run with a umask of 002 and have files created in their home directory
|
1995-03-08 22:44:37 +00:00
|
|
|
and not worry about others being able to read them.
|
|
|
|
|
1996-01-30 13:52:50 +00:00
|
|
|
For a shared area you create a separate uid/gid (like cvs or ncvs on freefall),
|
1995-03-08 22:44:37 +00:00
|
|
|
you place each person that should be able to access this area into that new
|
|
|
|
group.
|
|
|
|
|
1996-08-28 17:54:14 +00:00
|
|
|
This model of uid/gid administration allows far greater flexibility than lumping
|
1995-03-08 22:44:37 +00:00
|
|
|
users into groups and having to muck with the umask when working in a shared
|
|
|
|
area.
|
|
|
|
|
|
|
|
I have been using this model for almost 10 years and found that it works
|
|
|
|
for most situations, and has never gotten in the way. (Rod Grimes)
|
|
|
|
|
1995-01-09 11:26:31 +00:00
|
|
|
.Sh CONFIGURATION
|
|
|
|
.Bl -tag -width Ds -compact
|
|
|
|
.It Sy 1.
|
|
|
|
Read intern variables.
|
|
|
|
.It Sy 2.
|
|
|
|
Read config file (/etc/adduser.conf)
|
|
|
|
.It Sy 3.
|
|
|
|
Parse command line options
|
|
|
|
.El
|
|
|
|
|
|
|
|
.Sh OPTIONS
|
|
|
|
.Bl -tag -width Ds
|
1995-03-08 22:44:37 +00:00
|
|
|
.It Sy -batch username [group[,group]...] [fullname] [password]
|
|
|
|
Batch mode.
|
|
|
|
|
|
|
|
.It Sy -check_only
|
|
|
|
Check /etc/passwd, /etc/group, /etc/shells and exit.
|
|
|
|
|
|
|
|
.It Sy -create_config
|
|
|
|
Create new config and message file and exit.
|
|
|
|
|
|
|
|
.It Sy -dotdir Ar directory
|
|
|
|
Copy files from
|
|
|
|
.Ar directory
|
1996-08-28 17:54:14 +00:00
|
|
|
into the HOME-directory of new users,
|
1995-01-09 11:26:31 +00:00
|
|
|
.Ql Pa dot.foo
|
|
|
|
files renamed to
|
1996-08-28 17:54:14 +00:00
|
|
|
.Ql Pa .foo .
|
1995-01-09 11:26:31 +00:00
|
|
|
Don't copy files if
|
|
|
|
.Ar directory
|
|
|
|
equal with
|
1996-08-28 17:54:14 +00:00
|
|
|
.Ar no .
|
|
|
|
For security make all files writable and readable for owner,
|
1995-03-08 22:44:37 +00:00
|
|
|
don't allow group or world to write files and allow only owner
|
|
|
|
to read/execute/write .rhost, .Xauthority, .kermrc, .netrc, Mail,
|
|
|
|
prv, iscreen, term.
|
|
|
|
|
|
|
|
.It Sy -group Ar login_group
|
|
|
|
Login group.
|
|
|
|
.Ar USER
|
1996-08-28 17:54:14 +00:00
|
|
|
means use username as login group.
|
1995-03-08 22:44:37 +00:00
|
|
|
|
|
|
|
.It Sy -help,-h,-?
|
|
|
|
Print options and exit.
|
|
|
|
|
|
|
|
.It Sy -home Ar partition
|
|
|
|
Default home partition where all users located.
|
|
|
|
|
|
|
|
.It Sy -message Ar file
|
1995-01-09 11:26:31 +00:00
|
|
|
Send new users a welcome message.
|
|
|
|
Don't send message if
|
|
|
|
.Ar file
|
|
|
|
equal with
|
1996-08-28 17:54:14 +00:00
|
|
|
.Ar no .
|
1995-03-08 22:44:37 +00:00
|
|
|
|
|
|
|
.It Sy -noconfig
|
|
|
|
Do not read config file.
|
|
|
|
|
|
|
|
.It Sy -shell Ar shell
|
|
|
|
Default shell for new users.
|
|
|
|
|
|
|
|
.It Sy -silent,-s,-quit,-q
|
1996-01-30 13:52:50 +00:00
|
|
|
Few warnings, question, bug reports.
|
1995-03-08 22:44:37 +00:00
|
|
|
|
|
|
|
.It Sy -uid Ar uid
|
|
|
|
Use uid's from
|
|
|
|
.Ar uid
|
|
|
|
up.
|
|
|
|
|
|
|
|
.It Sy -verbose,-v
|
1996-01-30 13:52:50 +00:00
|
|
|
Many warning, question. Recommended for novice users.
|
1995-03-08 22:44:37 +00:00
|
|
|
|
|
|
|
|
1995-01-09 11:26:31 +00:00
|
|
|
|
|
|
|
.Sh FORMATS
|
|
|
|
.Bl -tag -width Ds -compact
|
|
|
|
.Ql Pa #
|
1995-03-08 22:44:37 +00:00
|
|
|
is a comment.
|
1995-01-09 11:26:31 +00:00
|
|
|
|
|
|
|
.P
|
|
|
|
.It Sy config file
|
1995-01-03 09:46:14 +00:00
|
|
|
.Nm Adduser
|
1996-08-28 17:54:14 +00:00
|
|
|
reads and writes this file.
|
1995-01-09 11:26:31 +00:00
|
|
|
See /etc/adduser.conf for more details.
|
|
|
|
.It Sy message file
|
|
|
|
Eval variables in this file. See /etc/adduser.message for more
|
|
|
|
details.
|
|
|
|
.El
|
|
|
|
|
1995-03-08 22:44:37 +00:00
|
|
|
.Sh EXAMPLES
|
|
|
|
.Pp
|
|
|
|
$ adduser
|
|
|
|
.Pp
|
|
|
|
Start adduser in interactive mode.
|
|
|
|
|
|
|
|
.Pp
|
|
|
|
$ adduser -batch baerenklau guest,staff,baer 'Teddy II' qwerty7
|
|
|
|
.Pp
|
|
|
|
Create user 'baerenklau' and login group 'baerenklau'. Invite user
|
|
|
|
baerenklau into groups guest, staff and baer. Realname (fullname)
|
|
|
|
is 'Teddy II'. Password is 'qwerty7' (don't use such password!). Create
|
|
|
|
HOME directory '/home/baerenklau' and copy all files and directories
|
|
|
|
from /usr/share/skel to /home/baerenklau. Send user baerenklau
|
|
|
|
a welcome message.
|
|
|
|
|
|
|
|
.Pp
|
|
|
|
$ adduser -uid 5000 -group guest -message no -batch vehlefanz
|
|
|
|
.Pp
|
|
|
|
Create user 'vehlefanz'. Login group is guest. Uid is up to
|
|
|
|
5000, for instance 5007. No other groups, no realname, no password.
|
|
|
|
Do not send a welcome message.
|
|
|
|
|
1994-12-30 12:03:48 +00:00
|
|
|
.Sh FILES
|
1995-01-09 11:26:31 +00:00
|
|
|
.Bl -tag -width /etc/master.passwdxx -compact
|
|
|
|
.It Pa /etc/master.passwd
|
|
|
|
user database
|
|
|
|
.It Pa /etc/group
|
|
|
|
group database
|
|
|
|
.It Pa /etc/shells
|
|
|
|
shell database
|
|
|
|
.It Pa /etc/adduser.conf
|
|
|
|
config file for adduser
|
|
|
|
.It Pa /etc/adduser.message
|
|
|
|
message file for adduser
|
|
|
|
.It Pa /usr/share/skel
|
|
|
|
skeletal login directory
|
|
|
|
.It Pa /var/log/adduser
|
|
|
|
logfile for adduser
|
|
|
|
.El
|
|
|
|
|
1994-12-30 12:03:48 +00:00
|
|
|
.Sh SEE ALSO
|
1995-01-09 11:26:31 +00:00
|
|
|
.Xr chpass 1 ,
|
|
|
|
.Xr finger 1 ,
|
|
|
|
.Xr passwd 1 ,
|
1996-06-09 20:45:35 +00:00
|
|
|
.Xr setlogin 2 ,
|
|
|
|
.Xr yp 4 ,
|
1995-01-09 11:26:31 +00:00
|
|
|
.Xr aliases 5 ,
|
|
|
|
.Xr passwd 5 ,
|
|
|
|
.Xr group 5 ,
|
|
|
|
.Xr shells 5 ,
|
|
|
|
.Xr pwd_mkdb 8 ,
|
|
|
|
.Xr vipw 8
|
|
|
|
|
|
|
|
.\" .Sh BUGS
|
1994-12-30 12:03:48 +00:00
|
|
|
|
|
|
|
.Sh HISTORY
|
1995-01-09 11:26:31 +00:00
|
|
|
The
|
|
|
|
.Nm
|
1996-08-23 00:57:08 +00:00
|
|
|
command appeared in
|
|
|
|
.Fx 2.1 .
|