1996-08-27 20:04:45 +00:00
|
|
|
.\" Copyright (c) 1995-1996 Wolfram Schneider <wosch@FreeBSD.org>. Berlin.
|
|
|
|
.\" All rights reserved.
|
2004-06-04 19:21:26 +00:00
|
|
|
.\" Copyright (c) 2002-2004 Michael Telahun Makonnen <mtm@FreeBSD.org>
|
2002-12-03 05:41:09 +00:00
|
|
|
.\" 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
|
|
|
.\"
|
1999-08-28 01:35:59 +00:00
|
|
|
.\" $FreeBSD$
|
1997-09-01 06:14:17 +00:00
|
|
|
.\"
|
2006-06-07 04:58:54 +00:00
|
|
|
.Dd June 7, 2006
|
1995-01-09 11:26:31 +00:00
|
|
|
.Dt ADDUSER 8
|
2001-07-10 15:12:08 +00:00
|
|
|
.Os
|
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
|
1995-03-08 22:44:37 +00:00
|
|
|
.Sh SYNOPSIS
|
2000-11-20 20:10:44 +00:00
|
|
|
.Nm
|
2004-03-16 13:46:29 +00:00
|
|
|
.Op Fl CDENShq
|
2002-12-03 05:41:09 +00:00
|
|
|
.Op Fl G Ar groups
|
|
|
|
.Op Fl L Ar login_class
|
|
|
|
.Op Fl d Ar partition
|
|
|
|
.Op Fl f Ar file
|
2003-03-20 16:36:03 +00:00
|
|
|
.Op Fl g Ar login_group
|
2002-12-03 05:41:09 +00:00
|
|
|
.Op Fl k Ar dotdir
|
|
|
|
.Op Fl m Ar message_file
|
|
|
|
.Op Fl s Ar shell
|
|
|
|
.Op Fl u Ar uid_start
|
|
|
|
.Op Fl w Ar type
|
1994-12-30 12:03:48 +00:00
|
|
|
.Sh DESCRIPTION
|
2002-07-14 14:47:15 +00:00
|
|
|
The
|
2002-12-04 14:44:20 +00:00
|
|
|
.Nm
|
|
|
|
utility is a shell script, implemented around the
|
2002-12-03 05:41:09 +00:00
|
|
|
.Xr pw 8
|
|
|
|
command, for adding new users.
|
|
|
|
It creates passwd/group entries, a home directory,
|
|
|
|
copies dotfiles and sends the new user a welcome message.
|
2002-12-04 14:44:20 +00:00
|
|
|
It supports two modes of operation.
|
|
|
|
It may be used interactively
|
|
|
|
at the command line to add one user at a time, or it may be directed
|
2002-12-03 05:41:09 +00:00
|
|
|
to get the list of new users from a file and operate in batch mode
|
|
|
|
without requiring any user interaction.
|
1996-12-23 00:10:22 +00:00
|
|
|
.Sh RESTRICTIONS
|
2002-12-04 14:44:20 +00:00
|
|
|
.Bl -tag -width indent
|
|
|
|
.It username
|
2000-03-06 09:45:37 +00:00
|
|
|
Login name.
|
2002-12-03 05:41:09 +00:00
|
|
|
The user name is restricted to whatever
|
|
|
|
.Xr pw 8
|
2002-12-04 14:44:20 +00:00
|
|
|
will accept.
|
|
|
|
Generally this means it
|
2006-09-29 17:57:04 +00:00
|
|
|
may contain only lowercase characters or digits but cannot begin with the
|
|
|
|
.Ql -
|
2006-06-07 04:58:54 +00:00
|
|
|
character.
|
2000-03-01 14:09:25 +00:00
|
|
|
Maximum length
|
2002-12-03 05:41:09 +00:00
|
|
|
is 16 characters.
|
2002-12-04 14:44:20 +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
|
2002-12-04 14:44:20 +00:00
|
|
|
limit for aesthetic reasons, it has never been of great importance to break
|
|
|
|
such a basic fundamental parameter in
|
|
|
|
.Ux .
|
2001-07-15 08:06:20 +00:00
|
|
|
You can change
|
|
|
|
.Dv UT_NAMESIZE
|
|
|
|
in
|
2003-09-10 19:24:35 +00:00
|
|
|
.In utmp.h
|
1996-12-23 00:10:22 +00:00
|
|
|
and recompile the
|
1996-06-09 20:45:35 +00:00
|
|
|
world; people have done this and it works, but you will have problems
|
|
|
|
with any precompiled programs, or source that assumes the 8-character
|
2006-06-07 04:58:54 +00:00
|
|
|
name limit, such as NIS.
|
2000-03-01 14:09:25 +00:00
|
|
|
The NIS protocol mandates an 8-character username.
|
1996-06-09 20:45:35 +00:00
|
|
|
If you need a longer login name for e-mail addresses,
|
|
|
|
you can define an alias in
|
2000-08-13 18:38:58 +00:00
|
|
|
.Pa /etc/mail/aliases .
|
2002-12-04 14:44:20 +00:00
|
|
|
.It "full name"
|
2002-12-03 05:41:09 +00:00
|
|
|
This is typically known as the gecos field and usually contains
|
2002-12-04 14:44:20 +00:00
|
|
|
the user's full name.
|
|
|
|
Additionally, it may contain a comma separated
|
|
|
|
list of values such as office number and work and home phones.
|
|
|
|
If the
|
2002-12-27 12:15:40 +00:00
|
|
|
name contains an ampersand it will be replaced by the capitalized
|
2002-12-03 05:41:09 +00:00
|
|
|
login name when displayed by other programs.
|
1996-12-23 00:10:22 +00:00
|
|
|
The
|
2002-12-04 14:44:20 +00:00
|
|
|
.Ql \&:
|
1996-12-23 00:10:22 +00:00
|
|
|
character is not allowed.
|
2002-12-04 14:44:20 +00:00
|
|
|
.It shell
|
2004-06-06 17:55:55 +00:00
|
|
|
Unless the
|
|
|
|
.Fl S
|
|
|
|
argument is supplied only valid shells from the shell database
|
2002-12-04 14:44:20 +00:00
|
|
|
.Pq Pa /etc/shells
|
|
|
|
are allowed.
|
2004-06-06 17:55:55 +00:00
|
|
|
In addition,
|
|
|
|
either the base name or the full path of the shell may be supplied.
|
2002-12-04 14:44:20 +00:00
|
|
|
.It UID
|
|
|
|
Automatically generated or your choice.
|
|
|
|
It must be less than 32000.
|
|
|
|
.It "GID/login group"
|
|
|
|
Automatically generated or your choice.
|
|
|
|
It must be less than 32000.
|
|
|
|
.It password
|
2002-12-03 05:41:09 +00:00
|
|
|
You may choose an empty password, disable the password, use a
|
|
|
|
randomly generated password or specify your own plaintext password,
|
|
|
|
which will be encrypted before being stored in the user database.
|
1995-01-09 11:26:31 +00:00
|
|
|
.El
|
1996-12-23 00:10:22 +00:00
|
|
|
.Sh UNIQUE GROUPS
|
2002-12-04 14:44:20 +00:00
|
|
|
Perhaps you are missing what
|
1996-12-23 00:10:22 +00:00
|
|
|
.Em can
|
|
|
|
be done with this scheme that falls apart
|
2002-11-08 22:04:31 +00:00
|
|
|
with most other schemes.
|
2003-02-04 11:12:36 +00:00
|
|
|
With each user in their own group,
|
|
|
|
they can safely run with a umask of 002 instead of the usual 022
|
2002-11-08 22:04:31 +00:00
|
|
|
and create files in their home directory
|
|
|
|
without worrying about others being able to change them.
|
1996-12-23 00:10:22 +00:00
|
|
|
.Pp
|
2002-12-04 14:44:20 +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-12-23 00:10:22 +00:00
|
|
|
.Pp
|
2002-12-04 14:44:20 +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.
|
1996-12-23 00:10:22 +00:00
|
|
|
.Pp
|
1995-03-08 22:44:37 +00:00
|
|
|
I have been using this model for almost 10 years and found that it works
|
2002-12-04 14:44:20 +00:00
|
|
|
for most situations, and has never gotten in the way.
|
|
|
|
(Rod Grimes)
|
1995-01-09 11:26:31 +00:00
|
|
|
.Sh CONFIGURATION
|
2002-12-03 05:41:09 +00:00
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
utility reads its configuration information from
|
2002-12-04 14:44:20 +00:00
|
|
|
.Pa /etc/adduser.conf .
|
|
|
|
If this file does not exist, it will use predefined defaults.
|
|
|
|
While this file may be edited by hand,
|
|
|
|
the safer option is to use the
|
|
|
|
.Fl C
|
|
|
|
command line argument.
|
|
|
|
With this argument,
|
2002-12-03 05:41:09 +00:00
|
|
|
.Nm
|
|
|
|
will start interactive input, save the answers to its prompts in
|
2002-12-04 14:44:20 +00:00
|
|
|
.Pa /etc/adduser.conf ,
|
2002-12-03 05:41:09 +00:00
|
|
|
and promptly exit without modifying the user
|
2002-12-04 14:44:20 +00:00
|
|
|
database.
|
|
|
|
Options specified on the command line will take precedence over
|
2002-12-03 05:41:09 +00:00
|
|
|
any values saved in this file.
|
1995-01-09 11:26:31 +00:00
|
|
|
.Sh OPTIONS
|
2002-12-04 14:44:20 +00:00
|
|
|
.Bl -tag -width indent
|
2002-12-03 05:41:09 +00:00
|
|
|
.It Fl C
|
2002-12-04 14:44:20 +00:00
|
|
|
Create new configuration file and exit.
|
|
|
|
This option is mutually exclusive with the
|
|
|
|
.Fl f
|
2002-12-03 05:41:09 +00:00
|
|
|
option.
|
|
|
|
.It Fl d Ar partition
|
2002-12-04 14:44:20 +00:00
|
|
|
Home partition.
|
|
|
|
Default partition, under which all user directories
|
2002-12-03 05:41:09 +00:00
|
|
|
will be located.
|
2004-03-16 13:46:29 +00:00
|
|
|
The
|
2004-06-04 19:21:26 +00:00
|
|
|
.Pa /nonexistent
|
2004-03-16 13:46:29 +00:00
|
|
|
partition is considered special.
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
script will not create and populate a home directory by that name.
|
|
|
|
Otherwise,
|
|
|
|
by default it attempts to create a home directory.
|
|
|
|
.It Fl D
|
|
|
|
Do not attempt to create the home directory.
|
2002-12-03 05:41:09 +00:00
|
|
|
.It Fl E
|
2002-12-04 14:44:20 +00:00
|
|
|
Disable the account.
|
|
|
|
This option will lock the account by prepending the string
|
|
|
|
.Dq Li *LOCKED*
|
|
|
|
to the password field.
|
|
|
|
The account may be unlocked
|
2002-12-03 05:41:09 +00:00
|
|
|
by the super-user with the
|
|
|
|
.Xr pw 8
|
|
|
|
command:
|
|
|
|
.Pp
|
2002-12-04 14:44:20 +00:00
|
|
|
.D1 Nm pw Cm unlock Op Ar name | uid
|
2002-12-03 05:41:09 +00:00
|
|
|
.It Fl f Ar file
|
|
|
|
Get the list of accounts to create from
|
|
|
|
.Ar file .
|
|
|
|
If
|
|
|
|
.Ar file
|
2002-12-04 14:44:20 +00:00
|
|
|
is
|
|
|
|
.Dq Fl ,
|
|
|
|
then get the list from standard input.
|
|
|
|
If this option is specified,
|
2002-12-03 05:41:09 +00:00
|
|
|
.Nm
|
2002-12-04 14:44:20 +00:00
|
|
|
will operate in batch mode and will not seek any user input.
|
|
|
|
If an error is encountered while processing an account, it will write a
|
|
|
|
message to standard error and move to the next account.
|
|
|
|
The format
|
2002-12-03 05:41:09 +00:00
|
|
|
of the input file is described below.
|
2003-03-20 16:36:03 +00:00
|
|
|
.It Fl g Ar login_group
|
2006-12-05 23:05:53 +00:00
|
|
|
Normally,
|
2003-03-20 16:36:03 +00:00
|
|
|
if no login group is specified,
|
|
|
|
it is assumed to be the same as the username.
|
|
|
|
This option makes
|
|
|
|
.Ar login_group
|
|
|
|
the default.
|
2002-12-03 05:41:09 +00:00
|
|
|
.It Fl G Ar groups
|
2002-12-04 14:44:20 +00:00
|
|
|
Additional groups.
|
2002-12-03 05:41:09 +00:00
|
|
|
This option allows the user to specify additional groups to add users to.
|
2003-03-20 16:36:03 +00:00
|
|
|
The user is a member of these groups in addition to their login group.
|
2002-12-03 05:41:09 +00:00
|
|
|
.It Fl h
|
|
|
|
Print a summary of options and exit.
|
|
|
|
.It Fl k Ar directory
|
2001-07-15 08:06:20 +00:00
|
|
|
Copy files from
|
|
|
|
.Ar directory
|
2002-12-03 05:41:09 +00:00
|
|
|
into the home
|
2002-12-04 14:44:20 +00:00
|
|
|
directory of new users;
|
|
|
|
.Pa dot.foo
|
2001-07-15 08:06:20 +00:00
|
|
|
will be renamed to
|
2002-12-04 14:44:20 +00:00
|
|
|
.Pa .foo .
|
2002-12-03 05:41:09 +00:00
|
|
|
.It Fl L Ar login_class
|
|
|
|
Set default login class.
|
|
|
|
.It Fl m Ar file
|
1997-09-01 06:14:17 +00:00
|
|
|
Send new users a welcome message from
|
|
|
|
.Ar file .
|
|
|
|
Specifying a value of
|
2002-12-04 14:44:20 +00:00
|
|
|
.Cm no
|
1997-09-01 06:14:17 +00:00
|
|
|
for
|
2001-07-15 08:06:20 +00:00
|
|
|
.Ar file
|
2002-12-04 14:44:20 +00:00
|
|
|
causes no message to be sent to new users.
|
|
|
|
Please note that the message
|
2002-12-03 05:41:09 +00:00
|
|
|
file can reference the internal variables of the
|
|
|
|
.Nm
|
|
|
|
script.
|
|
|
|
.It Fl N
|
1997-09-01 06:14:17 +00:00
|
|
|
Do not read the default configuration file.
|
2002-12-03 05:41:09 +00:00
|
|
|
.It Fl q
|
2002-12-04 14:44:20 +00:00
|
|
|
Minimal user feedback.
|
|
|
|
In particular, the random password will not be echoed to
|
2002-12-03 05:41:09 +00:00
|
|
|
standard output.
|
|
|
|
.It Fl s Ar shell
|
2002-12-04 14:44:20 +00:00
|
|
|
Default shell for new users.
|
|
|
|
The
|
2002-12-03 05:41:09 +00:00
|
|
|
.Ar shell
|
2004-06-06 17:55:55 +00:00
|
|
|
argument may be the base name of the shell or the full path.
|
|
|
|
Unless the
|
|
|
|
.Fl S
|
|
|
|
argument is supplied the shell must exist in
|
2002-12-04 14:44:20 +00:00
|
|
|
.Pa /etc/shells
|
2003-06-20 19:23:55 +00:00
|
|
|
or be the special shell
|
|
|
|
.Em nologin
|
2002-12-03 05:41:09 +00:00
|
|
|
to be considered a valid shell.
|
2004-03-16 13:46:29 +00:00
|
|
|
.It Fl S
|
|
|
|
The existence or validity of the specified shell will not be checked.
|
2002-12-03 05:41:09 +00:00
|
|
|
.It Fl u Ar uid
|
2002-12-04 14:44:20 +00:00
|
|
|
Use UIDs from
|
1995-03-08 22:44:37 +00:00
|
|
|
.Ar uid
|
1996-12-23 00:10:22 +00:00
|
|
|
on up.
|
2002-12-03 05:41:09 +00:00
|
|
|
.It Fl w Ar type
|
2002-12-04 14:44:20 +00:00
|
|
|
Password type.
|
|
|
|
The
|
2002-12-03 05:41:09 +00:00
|
|
|
.Nm
|
|
|
|
utility allows the user to specify what type of password to create.
|
|
|
|
The
|
|
|
|
.Ar type
|
|
|
|
argument may have one of the following values:
|
2002-12-04 14:44:20 +00:00
|
|
|
.Bl -tag -width ".Cm random"
|
|
|
|
.It Cm no
|
|
|
|
Disable the password.
|
2002-12-27 12:15:40 +00:00
|
|
|
Instead of an encrypted string, the password field will contain a single
|
2002-12-04 14:44:20 +00:00
|
|
|
.Ql *
|
|
|
|
character.
|
|
|
|
The user may not log in until the super-user
|
2002-12-03 05:41:09 +00:00
|
|
|
manually enables the password.
|
2002-12-04 14:44:20 +00:00
|
|
|
.It Cm none
|
2002-12-03 05:41:09 +00:00
|
|
|
Use an empty string as the password.
|
2002-12-04 14:44:20 +00:00
|
|
|
.It Cm yes
|
|
|
|
Use a user-supplied string as the password.
|
|
|
|
In interactive mode,
|
|
|
|
the user will be prompted for the password.
|
|
|
|
In batch mode, the
|
2002-12-03 05:41:09 +00:00
|
|
|
last (10th) field in the line is assumed to be the password.
|
2002-12-04 14:44:20 +00:00
|
|
|
.It Cm random
|
|
|
|
Generate a random string and use it as a password.
|
|
|
|
The password will be echoed to standard output.
|
|
|
|
In addition, it will be available for inclusion in the message file in the
|
|
|
|
.Va randompass
|
|
|
|
variable.
|
|
|
|
.El
|
2000-12-27 15:30:30 +00:00
|
|
|
.El
|
2002-12-03 05:41:09 +00:00
|
|
|
.Sh FORMAT
|
|
|
|
When the
|
2002-12-04 14:44:20 +00:00
|
|
|
.Fl f
|
|
|
|
option is used, the account information must be stored in a specific
|
|
|
|
format.
|
|
|
|
All empty lines or lines beginning with a
|
|
|
|
.Ql #
|
|
|
|
will be ignored.
|
|
|
|
All other lines must contain ten colon
|
|
|
|
.Pq Ql \&:
|
|
|
|
separated fields as described below.
|
|
|
|
Command line options do not take precedence
|
|
|
|
over values in the fields.
|
|
|
|
Only the password field may contain a
|
|
|
|
.Ql \&:
|
2002-12-03 05:41:09 +00:00
|
|
|
character as part of the string.
|
|
|
|
.Pp
|
2002-12-04 14:44:20 +00:00
|
|
|
.Sm off
|
|
|
|
.D1 Ar name : uid : gid : class : change : expire : gecos : home_dir : shell : password
|
|
|
|
.Sm on
|
|
|
|
.Bl -tag -width ".Ar password"
|
|
|
|
.It Ar name
|
|
|
|
Login name.
|
|
|
|
This field may not be empty.
|
|
|
|
.It Ar uid
|
|
|
|
Numeric login user ID.
|
|
|
|
If this field is left empty, it will be automatically generated.
|
|
|
|
.It Ar gid
|
|
|
|
Numeric primary group ID.
|
|
|
|
If this field is left empty, a group with the
|
|
|
|
same name as the user name will be created and its GID will be used
|
2002-12-03 05:41:09 +00:00
|
|
|
instead.
|
2002-12-04 14:44:20 +00:00
|
|
|
.It Ar class
|
|
|
|
Login class.
|
|
|
|
This field may be left empty.
|
|
|
|
.It Ar change
|
2002-12-03 05:41:09 +00:00
|
|
|
Password ageing.
|
2002-12-04 14:44:20 +00:00
|
|
|
This field denotes the password change date for the account.
|
|
|
|
The format of this field is the same as the format of the
|
|
|
|
.Fl p
|
2002-12-03 05:41:09 +00:00
|
|
|
argument to
|
|
|
|
.Xr pw 8 .
|
2002-12-04 14:44:20 +00:00
|
|
|
It may be
|
|
|
|
.Ar dd Ns - Ns Ar mmm Ns - Ns Ar yy Ns Op Ar yy ,
|
|
|
|
where
|
|
|
|
.Ar dd
|
|
|
|
is for the day,
|
|
|
|
.Ar mmm
|
|
|
|
is for the month in numeric or alphabetical format:
|
|
|
|
.Dq Li 10
|
|
|
|
or
|
|
|
|
.Dq Li Oct ,
|
|
|
|
and
|
|
|
|
.Ar yy Ns Op Ar yy
|
|
|
|
is the four or two digit year.
|
|
|
|
To denote a time relative to the current date the format is:
|
|
|
|
.No + Ns Ar n Ns Op Ar mhdwoy ,
|
|
|
|
where
|
|
|
|
.Ar n
|
|
|
|
denotes a number, followed by the minutes, hours, days, weeks,
|
|
|
|
months or years after which the password must be changed.
|
|
|
|
This field may be left empty to turn it off.
|
|
|
|
.It Ar expire
|
|
|
|
Account expiration.
|
|
|
|
This field denotes the expiry date of the account.
|
|
|
|
The account may not be used after the specified date.
|
|
|
|
The format of this field is the same as that for password ageing.
|
2002-12-03 05:41:09 +00:00
|
|
|
This field may be left empty to turn it off.
|
2002-12-04 14:44:20 +00:00
|
|
|
.It Ar gecos
|
2002-12-03 05:41:09 +00:00
|
|
|
Full name and other extra information about the user.
|
2002-12-04 14:44:20 +00:00
|
|
|
.It Ar home_dir
|
|
|
|
Home directory.
|
|
|
|
If this field is left empty, it will be automatically
|
2002-12-03 05:41:09 +00:00
|
|
|
created by appending the username to the home partition.
|
2004-03-16 13:46:29 +00:00
|
|
|
The
|
|
|
|
.Pa /nonexistent
|
|
|
|
home directory is considered special and
|
|
|
|
is understood to mean that no home directory is to be
|
|
|
|
created for the user.
|
2002-12-04 14:44:20 +00:00
|
|
|
.It Ar shell
|
|
|
|
Login shell.
|
2004-06-06 17:55:55 +00:00
|
|
|
This field should contain either the base name or
|
|
|
|
the full path to a valid login shell.
|
2002-12-04 14:44:20 +00:00
|
|
|
.It Ar password
|
|
|
|
User password.
|
|
|
|
This field should contain a plaintext string, which will
|
|
|
|
be encrypted before being placed in the user database.
|
|
|
|
If the password type is
|
|
|
|
.Cm yes
|
|
|
|
and this field is empty, it is assumed the account will have an empty password.
|
|
|
|
If the password type is
|
|
|
|
.Cm random
|
|
|
|
and this field is
|
|
|
|
.Em not
|
|
|
|
empty, its contents will be used
|
|
|
|
as a password.
|
|
|
|
This field will be ignored if the
|
|
|
|
.Fl p
|
|
|
|
option is used with a
|
|
|
|
.Cm no
|
2002-12-03 05:41:09 +00:00
|
|
|
or
|
2002-12-04 14:44:20 +00:00
|
|
|
.Cm none
|
|
|
|
argument.
|
2002-12-27 12:15:40 +00:00
|
|
|
Be careful not to terminate this field with a closing
|
2002-12-04 14:44:20 +00:00
|
|
|
.Ql \&:
|
|
|
|
because it will be treated as part of the password.
|
1995-01-09 11:26:31 +00:00
|
|
|
.El
|
1994-12-30 12:03:48 +00:00
|
|
|
.Sh FILES
|
2002-12-04 14:44:20 +00:00
|
|
|
.Bl -tag -width ".Pa /etc/adduser.message" -compact
|
1995-01-09 11:26:31 +00:00
|
|
|
.It Pa /etc/master.passwd
|
|
|
|
user database
|
|
|
|
.It Pa /etc/group
|
|
|
|
group database
|
|
|
|
.It Pa /etc/shells
|
|
|
|
shell database
|
1997-05-01 22:55:58 +00:00
|
|
|
.It Pa /etc/login.conf
|
|
|
|
login classes database
|
1995-01-09 11:26:31 +00:00
|
|
|
.It Pa /etc/adduser.conf
|
2002-12-04 14:44:20 +00:00
|
|
|
configuration file for
|
|
|
|
.Nm
|
1995-01-09 11:26:31 +00:00
|
|
|
.It Pa /etc/adduser.message
|
2002-12-04 14:44:20 +00:00
|
|
|
message file for
|
|
|
|
.Nm
|
1995-01-09 11:26:31 +00:00
|
|
|
.It Pa /usr/share/skel
|
|
|
|
skeletal login directory
|
|
|
|
.It Pa /var/log/adduser
|
2002-12-04 14:44:20 +00:00
|
|
|
logfile for
|
|
|
|
.Nm
|
1995-01-09 11:26:31 +00:00
|
|
|
.El
|
1994-12-30 12:03:48 +00:00
|
|
|
.Sh SEE ALSO
|
1995-01-09 11:26:31 +00:00
|
|
|
.Xr chpass 1 ,
|
|
|
|
.Xr passwd 1 ,
|
2004-03-30 21:50:42 +00:00
|
|
|
.Xr adduser.conf 5 ,
|
1995-01-09 11:26:31 +00:00
|
|
|
.Xr aliases 5 ,
|
|
|
|
.Xr group 5 ,
|
1997-05-01 22:55:58 +00:00
|
|
|
.Xr login.conf 5 ,
|
1997-01-20 00:03:00 +00:00
|
|
|
.Xr passwd 5 ,
|
1995-01-09 11:26:31 +00:00
|
|
|
.Xr shells 5 ,
|
2006-06-07 04:58:54 +00:00
|
|
|
.Xr adding_user 8 ,
|
1998-08-17 18:50:29 +00:00
|
|
|
.Xr pw 8 ,
|
1995-01-09 11:26:31 +00:00
|
|
|
.Xr pwd_mkdb 8 ,
|
1996-11-17 03:51:33 +00:00
|
|
|
.Xr rmuser 8 ,
|
2002-01-14 16:59:03 +00:00
|
|
|
.Xr vipw 8 ,
|
|
|
|
.Xr yp 8
|
1994-12-30 12:03:48 +00:00
|
|
|
.Sh HISTORY
|
1995-01-09 11:26:31 +00:00
|
|
|
The
|
|
|
|
.Nm
|
2002-12-03 05:41:09 +00:00
|
|
|
command appeared in
|
1996-08-23 00:57:08 +00:00
|
|
|
.Fx 2.1 .
|
2002-12-03 05:41:09 +00:00
|
|
|
.Sh AUTHORS
|
2002-12-04 14:44:20 +00:00
|
|
|
.An -nosplit
|
|
|
|
This manual page and the original script, in Perl, was written by
|
|
|
|
.An Wolfram Schneider Aq wosch@FreeBSD.org .
|
|
|
|
The replacement script, written as a Bourne
|
2002-12-03 05:41:09 +00:00
|
|
|
shell script with some enhancements, and the man page modification that
|
|
|
|
came with it were done by
|
2002-12-04 14:44:20 +00:00
|
|
|
.An Mike Makonnen Aq mtm@identd.net .
|
2002-12-03 05:41:09 +00:00
|
|
|
.Sh BUGS
|
|
|
|
In order for
|
|
|
|
.Nm
|
2002-12-04 14:44:20 +00:00
|
|
|
to correctly expand variables such as
|
|
|
|
.Va $username
|
|
|
|
and
|
|
|
|
.Va $randompass
|
|
|
|
in the message sent to new users, it must let the shell evaluate
|
|
|
|
each line of the message file.
|
|
|
|
This means that shell commands can also be embedded in the message file.
|
|
|
|
The
|
2002-12-03 05:41:09 +00:00
|
|
|
.Nm
|
2002-12-27 12:15:40 +00:00
|
|
|
utility attempts to mitigate the possibility of an attacker using this
|
2006-12-05 23:05:53 +00:00
|
|
|
feature by refusing to evaluate the file if it is not owned and writable
|
2002-12-04 14:44:20 +00:00
|
|
|
only by the root user.
|
|
|
|
In addition, shell special characters and operators will have to be
|
|
|
|
escaped when used in the message file.
|
2002-12-03 05:41:09 +00:00
|
|
|
.Pp
|
2006-12-05 23:20:14 +00:00
|
|
|
Also, password ageing and account expiry times are currently settable
|
2004-03-30 21:50:42 +00:00
|
|
|
only in batch mode or when specified in
|
|
|
|
.Pa /etc/adduser.conf .
|
2002-12-03 05:41:09 +00:00
|
|
|
The user should be able to set them in interactive mode as well.
|