200 lines
6.5 KiB
Groff
200 lines
6.5 KiB
Groff
.\"Generated by db2man.xsl. Don't modify this, modify the source.
|
|
.de Sh \" Subsection
|
|
.br
|
|
.if t .Sp
|
|
.ne 5
|
|
.PP
|
|
\fB\\$1\fR
|
|
.PP
|
|
..
|
|
.de Sp \" Vertical space (when we can't use .PP)
|
|
.if t .sp .5v
|
|
.if n .sp
|
|
..
|
|
.de Ip \" List item
|
|
.br
|
|
.ie \\n(.$>=3 .ne \\$3
|
|
.el .ne 3
|
|
.IP "\\$1" \\$2
|
|
..
|
|
.TH "USERADD" 8 "" "" ""
|
|
.SH NAME
|
|
useradd \- Create a new user or update default new user information
|
|
.SH "SYNOPSIS"
|
|
.ad l
|
|
.hy 0
|
|
.HP 8
|
|
\fBuseradd\fR [\-c\ \fIcomment\fR] [\-d\ \fIhome_dir\fR] [\-e\ \fIexpire_date\fR] [\-f\ \fIinactive_days\fR]
|
|
.br
|
|
[\-g\ \fIinitial_group\fR] [\-G\ \fIgroup1\fR\ [\fI,group2,\fR...\ \fI,\fR\ [\fIgroupN\fR]]]
|
|
.br
|
|
[[\-M]\ \-m\ [\-k\ \fIskeleton_dir\fR]] [\-o] [\-p\ \fIpasswd\fR] [\-s\ \fIshell\fR]
|
|
.br
|
|
[\-u\ \fIuid\fR] \fIlogin\fR \fIuseradd\fR \-D [\-g\ \fIgroup\fR] [\-b\ \fIhome_dir\fR] [\-e\ \fIexpire_date\fR]
|
|
.br
|
|
[\-f\ \fIinactive_days\fR] [\-s\ \fIshell\fR]
|
|
.ad
|
|
.hy
|
|
|
|
.SH "DESCRIPTION"
|
|
|
|
.SS "Creating New Users"
|
|
|
|
.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
|
|
\fB\-c\fR \fIcomment\fR
|
|
The new user's password file comment field\&.
|
|
|
|
.TP
|
|
\fB\-d\fR \fIhome_dir\fR
|
|
The new user will be created using \fI home_dir \fRas the value for the user's login directory\&. The default is to append the \fIlogin\fR name to \fIhome\fR and use that as the login directory name\&.
|
|
|
|
.TP
|
|
\fB\-e\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
|
|
\fB\-f\fR \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\&.
|
|
|
|
.TP
|
|
\fB\-g\fR \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 or whatever is specified in \fI/etc/default/useradd\fR\&.
|
|
|
|
.TP
|
|
\fB\-G\fR \fIgroup1\fR[\fI ,group2,\&.\&.\&., \fR [\fIgroupN\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
|
|
\fB\-M\fR
|
|
RedHat added the CREATE_HOME option in login\&.defs in their version of shadow\-utils (which makes \-m the default, with new \-M option to turn it off)\&. Unfortunately, this changes the way useradd works (it can be run by scripts expecting some standard behaviour), compared to other Unices and other Linux distributions, and also adds a lot of confusion\&.
|
|
|
|
.TP
|
|
\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 \fI skeleton_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
|
|
\fB\-o\fR
|
|
Allow create user with duplicate (non\-unique) UID\&.
|
|
|
|
.TP
|
|
\fB\-p\fR \fIpasswd\fR
|
|
The encrypted password, as returned by \fBcrypt\fR(3)\&. The default is to disable the account\&.
|
|
|
|
.TP
|
|
\fB\-s\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
|
|
\fB\-u\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
|
|
\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\fR to create the new directory name if the \fB\-d\fR option is not used when creating a new account\&.
|
|
|
|
.TP
|
|
\fB\-e\fR \fIexpire_date\fR
|
|
The date on which the user account is disabled\&.
|
|
|
|
.TP
|
|
\fB\-f\fR \fIinactive\fR
|
|
The number of days after a password has expired before the account will be disabled\&.
|
|
|
|
.TP
|
|
\fB\-g\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
|
|
\fB\-s\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\&.
|
|
|
|
.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 an NIS group\&. This must be performed on the NIS server\&.
|
|
|
|
.SH "FILES"
|
|
|
|
.TP
|
|
\fI/etc/passwd\fR
|
|
user account information
|
|
.TP
|
|
\fI/etc/shadow\fR
|
|
secure user account information
|
|
.TP
|
|
\fI/etc/group\fR
|
|
group account information
|
|
.TP
|
|
\fI/etc/default/useradd\fR
|
|
default information
|
|
.TP
|
|
\fI/etc/skel/\fR
|
|
directory containing default files
|
|
.SH "EXIT VALUES"
|
|
|
|
.PP
|
|
The \fBuseadd\fR command exits with the following values:
|
|
|
|
.TP
|
|
\fI0\fR
|
|
success
|
|
.TP
|
|
\fI1\fR
|
|
can't update password file
|
|
.TP
|
|
\fI2\fR
|
|
invalid command syntax
|
|
.TP
|
|
\fI3\fR
|
|
invalid argument to option
|
|
.TP
|
|
\fI4\fR
|
|
uid already in use (and no \-o)
|
|
.TP
|
|
\fI6\fR
|
|
specified group doesn't exist
|
|
.TP
|
|
\fI9\fR
|
|
username already in use
|
|
.TP
|
|
\fI10\fR
|
|
can't update group file
|
|
.TP
|
|
\fI12\fR
|
|
can't create home directory
|
|
.TP
|
|
\fI13\fR
|
|
can't create mail spool
|
|
|
|
.SH "SEE ALSO"
|
|
|
|
.PP
|
|
\fBchfn\fR(1), \fBchsh\fR(1), \fBpasswd\fR(1), \fBcrypt\fR(3), \fBgroupadd\fR(8), \fBgroupdel\fR(8), \fBgroupmod\fR(8), \fBuserdel\fR(8), \fBusermod\fR(8)
|
|
|
|
.SH "AUTHOR"
|
|
|
|
.PP
|
|
Julianne Frances Haugh (jockgrrl@ix\&.netcom\&.com)
|
|
|