]> granicus.if.org Git - shadow/blobdiff - man/useradd.8
[svn-upgrade] Integrating new upstream version, shadow (4.0.16)
[shadow] / man / useradd.8
index 6f617b13361e6fada590e0449d9a2392457a42bd..aa5ecea666166810b4b89b0c2955a49467e560ca 100644 (file)
-.\" Copyright 1991 - 1994, Julianne Frances Haugh
-.\" All rights reserved.
+.\"     Title: useradd
+.\"    Author: 
+.\" Generator: DocBook XSL Stylesheets v1.70.1 <http://docbook.sf.net/>
+.\"      Date: 06/06/2006
+.\"    Manual: System Management Commands
+.\"    Source: System Management Commands
 .\"
-.\" 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.
-.\" 3. Neither the name of Julianne F. Haugh nor the names of its contributors
-.\"    may be used to endorse or promote products derived from this software
-.\"    without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY JULIE HAUGH 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 JULIE HAUGH 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.
-.\"
-.\"    $Id: useradd.8,v 1.8 2000/10/16 21:34:40 kloczek Exp $
-.\"
-.TH USERADD 8
-.SH NAME
-useradd \- Create a new user or update default new user information
-.SH SYNOPSIS
-.TP 8
-.B useradd
-.\" .RB [ -A
-.\" .RI { method | \fBDEFAULT\fR "},... ]"
-.RB [ -c
-.IR comment ]
-.RB [ -d
-.IR home_dir ]
-.br
-.RB [ -e
-.IR expire_date ]
-.RB [ -f
-.IR inactive_time ]
-.br
-.RB [ -g
-.IR initial_group ]
-.RB [ -G
-.IR group [,...]]
-.br
-.RB [ -m " [" -k
-.IR skeleton_dir ]]
-.RB [ -p
-.IR passwd ]
-.br
-.RB [ -s
-.IR shell ]
-.RB [ -u
-.IR uid " ["
-.BR -o ]]
-.I login
-.TP 8
-.B useradd
-\fB-D\fR
-[\fB-g\fI default_group\fR]
-[\fB-b\fI default_home\fR]
-.br
-[\fB-f\fI default_inactive\fR]
-[\fB-e\fI default_expire_date\fR]
-.br
-[\fB-s\fI default_shell\fR]
-.SH DESCRIPTION
-.SS Creating New Users
-When invoked without the \fB-D\fR option, the \fBuseradd\fR command
-creates a new user account using the values specified on the
-command line and the default values from the system.
-The new user account will be entered into the system files as needed,
-the home directory will be created, and initial files copied, depending
-on the command line options.
-The options which apply to the \fBuseradd\fR command are
-.\" .IP "\fB-A {\fImethod\fR|\fBDEFAULT\fR},..."
-.\" The value of the user's authentication method.
-.\" The authentication method is the name of a program which is responsible
-.\" for validating the user's identity.
-.\" The string \fBDEFAULT\fR may be used to change the user's authentication
-.\" method to the standard system password method.
-.\" This is a comma-separated list of program names.
-.\" It may include \fBDEFAULT\fR exactly once.
-.IP "\fB-c \fIcomment\fR"
-The new user's password file comment field.
-.IP "\fB-d \fIhome_dir\fR"
-The new user will be created using \fIhome_dir\fR as the value for
-the user's login directory.
-The default is to append the \fIlogin\fR name to \fIdefault_home\fR
-and use that as the login directory name.
-.IP "\fB-e \fIexpire_date\fR"
-The date on which the user account will be disabled.
-The date is specified in the format \fIYYYY-MM-DD\fR.
-.IP "\fB-f \fIinactive_days\fR"
-The number of days after a password expires until the account
-is permanently disabled.
-A value of 0 disables the account as soon as the password has
-expired, and a value of -1 disables the feature.
-The default value is -1.
-.IP "\fB-g \fIinitial_group\fR"
-The group name or number of the user's initial login group.
-The group name must exist.  A group number must refer to an
-already existing group.
-The default group number is 1.
-.IP "\fB-G \fIgroup,[...]\fR"
-A list of supplementary groups which the user is also a member
-of.
-Each group is separated from the next by a comma, with no
-intervening whitespace.
-The groups are subject to the same restrictions as the group
-given with the \fB-g\fR option.
-The default is for the user to belong only to the initial group.
-.IP \fB-m\fR
-The user's home directory will be created if it does not exist.
-The files contained in \fIskeleton_dir\fR will be copied to the
-home directory if the \fB-k\fR option is used, otherwise the
-files contained in \fI/etc/skel\fR will be used instead.
-Any directories contained in \fIskeleton_dir\fR or \fI/etc/skel\fR
-will be created in the user's home directory as well.
-The \fB-k\fR option is only valid in conjunction with the \fB-m\fR
-option.
-The default is to not create the directory and to not copy any
-files.
-.IP "\fB-p \fIpasswd\fR"
-The encrypted password, as returned by \fBcrypt\fR(3).
-The default is to disable the account.
-.IP "\fB-s \fIshell\fR"
-The name of the user's login shell.
-The default is to leave this field blank, which causes the system
-to select the default login shell.
-.IP "\fB-u \fIuid\fR"
-The numerical value of the user's ID.
-This value must be unique, unless the \fI-o\fR option is used.
-The value must be non-negative.
-The default is to use the smallest ID value greater than 99 and
-greater than every other user.
-Values between 0 and 99 are typically reserved for system accounts.
-.SS Changing the default values
-When invoked with the \fB-D\fR option, \fBuseradd\fR will either
-display the current default values, or update the default values
-from the command line.
-The valid options are
-.IP "\fB-b \fIdefault_home\fR"
-The initial path prefix for a new user's home directory.
-The user's name will be affixed to the end of \fIdefault_home\fR
-to create the new directory name if the \fB-d\fI option is not
-used when creating a new account.
-.IP "\fB-e \fIdefault_expire_date\fR"
+.TH "USERADD" "8" "06/06/2006" "System Management Commands" "System Management Commands"
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.SH "NAME"
+useradd \- create a new user or update default new user information
+.SH "SYNOPSIS"
+.HP 8
+\fBuseradd\fR [\fIoptions\fR] \fILOGIN\fR
+.HP 8
+\fBuseradd\fR \-D
+.HP 8
+\fBuseradd\fR \-D [\fIoptions\fR]
+.SH "DESCRIPTION"
+.PP
+When invoked without the
+\fB\-D\fR
+option, the
+\fBuseradd\fR
+command creates a new user account using the values specified on the command line and the default values from the system. Depending on command line options, the useradd command will update system files and may also create the new user's home directory and copy initial files.
+.SH "OPTIONS"
+.PP
+The options which apply to the
+\fBuseradd\fR
+command are:
+.TP 3n
+\fB\-c\fR, \fB\-\-comment\fR \fICOMMENT\fR
+Any text string. It is generally a short description of the login, and is currently used as the field for the user's full name.
+.TP 3n
+\fB\-b\fR, \fB\-\-base\-dir\fR \fIBASE_DIR\fR
+The default base directory for the system if
+\fB\-d\fR
+dir is not specified.
+\fIBASE_DIR\fR
+is concatenated with the account name to define the home directory. If the
+\fB\-m\fR
+option is not used,
+\fIBASE_DIR\fR
+must exist.
+.TP 3n
+\fB\-d\fR, \fB\-\-home\fR \fIHOME_DIR\fR
+The new user will be created using
+\fIHOME_DIR\fR
+as the value for the user's login directory. The default is to append the
+\fILOGIN\fR
+name to
+\fIBASE_DIR\fR
+and use that as the login directory name. The directory
+\fIHOME_DIR\fR
+does not have to exist but will not be created if it is missing.
+.TP 3n
+\fB\-e\fR, \fB\-\-expiredate\fR \fIEXPIRE_DATE\fR
+The date on which the user account will be disabled. The date is specified in the format
+\fIYYYY\-MM\-DD\fR.
+.TP 3n
+\fB\-f\fR, \fB\-\-inactive\fR \fIINACTIVE\fR
+The number of days after a password expires until the account is permanently disabled. A value of 0 disables the account as soon as the password has expired, and a value of \-1 disables the feature. The default value is \-1.
+.TP 3n
+\fB\-g\fR, \fB\-\-gid\fR \fIGROUP\fR
+The group name or number of the user's initial login group. The group name must exist. A group number must refer to an already existing group. The default group number is 1 or whatever is specified in
+\fI/etc/default/useradd\fR.
+.TP 3n
+\fB\-G\fR, \fB\-\-groups\fR \fIGROUP1\fR[\fI,GROUP2,...\fR[\fI,GROUPN\fR]]]
+A list of supplementary groups which the user is also a member of. Each group is separated from the next by a comma, with no intervening whitespace. The groups are subject to the same restrictions as the group given with the
+\fB\-g\fR
+option. The default is for the user to belong only to the initial group.
+.TP 3n
+\fB\-h\fR, \fB\-\-help\fR
+Display help message and exit.
+.TP 3n
+\fB\-m\fR, \fB\-\-create\-home\fR
+The user's home directory will be created if it does not exist. The files contained in
+\fISKEL_DIR\fR
+will be copied to the home directory if the
+\fB\-k\fR
+option is used, otherwise the files contained in
+\fI/etc/skel\fR
+will be used instead. Any directories contained in
+\fISKEL_DIR\fR
+or
+\fI/etc/skel\fR
+will be created in the user's home directory as well. The
+\fB\-k\fR
+option is only valid in conjunction with the
+\fB\-m\fR
+option. The default is to not create the directory and to not copy any files.
+.TP 3n
+\fB\-K\fR, \fB\-\-key\fR \fIKEY\fR=\fIVALUE\fR
+Overrides /etc/login.defs defaults (UID_MIN, UID_MAX, UMASK, PASS_MAX_DAYS and others).
+
+Example:
+\fB\-K \fR\fIPASS_MAX_DAYS\fR=\fI\-1\fR
+can be used when creating system account to turn off password ageing, even though system account has no password at all. Multiple
+\fB\-K\fR
+options can be specified, e.g.:
+\fB\-K \fR
+\fIUID_MIN\fR=\fI100\fR
+\fB \-K \fR
+\fIUID_MAX\fR=\fI499\fR
+.sp
+Note:
+\fB\-K \fR
+\fIUID_MIN\fR=\fI10\fR,\fIUID_MAX\fR=\fI499\fR
+doesn't work yet.
+.TP 3n
+\fB\-o\fR, \fB\-\-non\-unique\fR
+Allow the creation of a user account with a duplicate (non\-unique) UID.
+.TP 3n
+\fB\-p\fR, \fB\-\-password\fR \fIPASSWORD\fR
+The encrypted password, as returned by
+\fBcrypt\fR(3). The default is to disable the account.
+.TP 3n
+\fB\-s\fR, \fB\-\-shell\fR \fISHELL\fR
+The name of the user's login shell. The default is to leave this field blank, which causes the system to select the default login shell.
+.TP 3n
+\fB\-u\fR, \fB\-\-uid\fR \fIUID\fR
+The numerical value of the user's ID. This value must be unique, unless the
+\fB\-o\fR
+option is used. The value must be non\-negative. The default is to use the smallest ID value greater than 999 and greater than every other user. Values between 0 and 999 are typically reserved for system accounts.
+.SS "Changing the default values"
+.PP
+When invoked with the
+\fB\-D\fR
+option,
+\fBuseradd\fR
+will either display the current default values, or update the default values from the command line. The valid options are
+.TP 3n
+\fB\-b\fR \fIHOME_DIR\fR
+The initial path prefix for a new user's home directory. The user's name will be affixed to the end of
+\fIHOME_DIR\fR
+to create the new directory name if the
+\fB\-d\fR
+option is not used when creating a new account.
+.TP 3n
+\fB\-e\fR \fIEXPIRE_DATE\fR
 The date on which the user account is disabled.
-.IP "\fB-f \fIdefault_inactive\fR"
-The number of days after a password has expired before the
-account will be disabled.
-.IP "\fB-g \fIdefault_group\fR"
-The group name or ID for a new user's initial group.
-The named group must exist, and a numerical group ID must have
-an existing entry .
-.IP "\fB-s \fIdefault_shell\fR"
-The name of the new user's login shell.
-The named program will be used for all future new user accounts.
+.TP 3n
+\fB\-f\fR \fIINACTIVE\fR
+The number of days after a password has expired before the account will be disabled.
+.TP 3n
+\fB\-g\fR, \fB\-\-gid\fR \fIGROUP\fR
+The group name or ID for a new user's initial group. The named group must exist, and a numerical group ID must have an existing entry.
+.TP 3n
+\fB\-s\fR, \fB\-\-shell\fR \fISHELL\fR
+The name of the new user's login shell. The named program will be used for all future new user accounts.
+.PP
+If no options are specified,
+\fBuseradd\fR
+displays the current default values.
+.\" end of SS subsection "Changing the default values"
+.SH "NOTES"
+.PP
+The system administrator is responsible for placing the default user files in the
+\fI/etc/skel/\fR
+directory.
+.SH "CAVEATS"
+.PP
+You may not add a user to a NIS group. This must be performed on the NIS server.
+.PP
+Similarly, if the username already exists in an external user database such as NIS,
+\fBuseradd\fR
+will deny the user account creation request.
+.PP
+Usernames must begin with a lower case letter or an underscore, and only lower case letters, underscores, dashes, and dollar signs may follow. In regular expression terms: [a\-z_][a\-z0\-9_\-]*[$]
+.SH "FILES"
+.TP 3n
+\fI/etc/passwd\fR
+User account information.
+.TP 3n
+\fI/etc/shadow\fR
+Secure user account information.
+.TP 3n
+\fI/etc/group\fR
+Group account information.
+.TP 3n
+\fI/etc/default/useradd\fR
+Default values for account creation.
+.TP 3n
+\fI/etc/skel/\fR
+Directory containing default files.
+.TP 3n
+\fI/etc/login.defs\fR
+Shadow password suite configuration.
+.SH "EXIT VALUES"
+.PP
+The
+\fBuseradd\fR
+command exits with the following values:
+.TP 3n
+\fI0\fR
+success
+.TP 3n
+\fI1\fR
+can't update password file
+.TP 3n
+\fI2\fR
+invalid command syntax
+.TP 3n
+\fI3\fR
+invalid argument to option
+.TP 3n
+\fI4\fR
+UID already in use (and no
+\fB\-o\fR)
+.TP 3n
+\fI6\fR
+specified group doesn't exist
+.TP 3n
+\fI9\fR
+username already in use
+.TP 3n
+\fI10\fR
+can't update group file
+.TP 3n
+\fI12\fR
+can't create home directory
+.TP 3n
+\fI13\fR
+can't create mail spool
+.SH "SEE ALSO"
 .PP
-If no options are specified, \fBuseradd\fR displays the current
-default values.
-.SH NOTES
-The system administrator is responsible for placing the default
-user files in the \fI/etc/skel\fR directory.
-.SH CAVEATS
-You may not add a user to an NIS group.
-This must be performed on the NIS server.
-.SH FILES
-/etc/passwd \- user account information
-.br
-/etc/shadow \- secure user account information
-.br
-/etc/group \- group information
-.br
-/etc/default/useradd \- default information
-.br
-/etc/skel \- directory containing default files
-.SH SEE ALSO
-.BR chfn (1),
-.BR chsh (1),
-.BR crypt (3),
-.BR groupadd (8),
-.BR groupdel (8),
-.BR groupmod (8),
-.BR passwd (1),
-.BR userdel (8),
-.BR usermod (8)
-.SH AUTHOR
-Julianne Frances Haugh (jockgrrl@ix.netcom.com)
+
+\fBchfn\fR(1),
+\fBchsh\fR(1),
+\fBpasswd\fR(1),
+\fBcrypt\fR(3),
+\fBgroupadd\fR(8),
+\fBgroupdel\fR(8),
+\fBgroupmod\fR(8),
+\fBlogin.defs\fR(5),
+\fBuserdel\fR(8),
+\fBusermod\fR(8).