{"id":3836,"date":"2022-12-20T17:20:13","date_gmt":"2022-12-20T20:20:13","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/useradd-man8\/"},"modified":"2022-12-20T17:20:13","modified_gmt":"2022-12-20T20:20:13","slug":"useradd-man8","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/useradd-man8\/","title":{"rendered":"USERADD (man8)"},"content":{"rendered":"<h1 align=\"center\">USERADD<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#OPTIONS\">OPTIONS<\/a><br \/> <a href=\"#NOTES\">NOTES<\/a><br \/> <a href=\"#CAVEATS\">CAVEATS<\/a><br \/> <a href=\"#CONFIGURATION\">CONFIGURATION<\/a><br \/> <a href=\"#FILES\">FILES<\/a><br \/> <a href=\"#EXIT VALUES\">EXIT VALUES<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">useradd \u2212 create a new user or update default new user information<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"35%\">\n<p style=\"margin-top: 1em\"><b>useradd<\/b> [<i>options<\/i>] <i>LOGIN<\/i><\/p>\n<\/td>\n<td width=\"54%\"> <\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"35%\">\n<p style=\"margin-top: 1em\"><b>useradd<\/b> \u2212D<\/p>\n<\/td>\n<td width=\"54%\"> <\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"35%\">\n<p style=\"margin-top: 1em\"><b>useradd<\/b> \u2212D [<i>options<\/i>]<\/p>\n<\/td>\n<td width=\"54%\"> <\/td>\n<\/tr>\n<\/table>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">When invoked without the <b>\u2212D<\/b> option, the <b>useradd<\/b> command creates a new user account using the values specified on the command line plus the default values from the system. Depending on command line options, the <b>useradd<\/b> command will update system files and may also create the new user&#8217;s home directory and copy initial files.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">By default, a group will also be created for the new user (see <b>\u2212g<\/b>, <b>\u2212N<\/b>, <b>\u2212U<\/b>, and <b>USERGROUPS_ENAB<\/b>).<\/p>\n<h2>OPTIONS <a name=\"OPTIONS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The options which apply to the <b>useradd<\/b> command are:<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>\u2212b<\/b>, <b>\u2212\u2212base\u2212dir\u00a0<\/b><i>BASE_DIR<\/i><\/p>\n<p style=\"margin-left:17%;\">The default base directory for the system if <b>\u2212d\u00a0<\/b><i>HOME_DIR<\/i> is not specified. <i>BASE_DIR<\/i> is concatenated with the account name to define the home directory. If the <b>\u2212m<\/b> option is not used, <i>BASE_DIR<\/i> must exist.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">If this option is not specified, <b>useradd<\/b> will use the base directory specified by the <b>HOME<\/b> variable in \/etc\/default\/useradd, or \/home by default.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>\u2212c<\/b>, <b>\u2212\u2212comment\u00a0<\/b><i>COMMENT<\/i><\/p>\n<p style=\"margin-left:17%;\">Any text string. It is generally a short description of the login, and is currently used as the field for the user&#8217;s full name.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>\u2212d<\/b>, <b>\u2212\u2212home\u2212dir\u00a0<\/b><i>HOME_DIR<\/i><\/p>\n<p style=\"margin-left:17%;\">The new user will be created using <i>HOME_DIR<\/i> as the value for the user&#8217;s login directory. The default is to append the <i>LOGIN<\/i> name to <i>BASE_DIR<\/i> and use that as the login directory name. The directory <i>HOME_DIR<\/i> does not have to exist but will not be created if it is missing.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>\u2212D<\/b>, <b>\u2212\u2212defaults<\/b><\/p>\n<p style=\"margin-left:17%;\">See below, the subsection &#8220;Changing the default values&#8221;.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>\u2212e<\/b>, <b>\u2212\u2212expiredate\u00a0<\/b><i>EXPIRE_DATE<\/i><\/p>\n<p style=\"margin-left:17%;\">The date on which the user account will be disabled. The date is specified in the format <i>YYYY\u2212MM\u2212DD<\/i>.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">If not specified, <b>useradd<\/b> will use the default expiry date specified by the <b>EXPIRE<\/b> variable in \/etc\/default\/useradd, or an empty string (no expiry) by default.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>\u2212f<\/b>, <b>\u2212\u2212inactive\u00a0<\/b><i>INACTIVE<\/i><\/p>\n<p style=\"margin-left:17%;\">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 \u22121 disables the feature.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">If not specified, <b>useradd<\/b> will use the default inactivity period specified by the <b>INACTIVE<\/b> variable in \/etc\/default\/useradd, or \u22121 by default.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>\u2212g<\/b>, <b>\u2212\u2212gid\u00a0<\/b><i>GROUP<\/i><\/p>\n<p style=\"margin-left:17%;\">The group name or number of the user&#8217;s initial login group. The group name must exist. A group number must refer to an already existing group.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">If not specified, the behavior of <b>useradd<\/b> will depend on the <b>USERGROUPS_ENAB<\/b> variable in \/etc\/login.defs. If this variable is set to <i>yes<\/i> (or <b>\u2212U\/\u2212\u2212user\u2212group<\/b> is specified on the command line), a group will be created for the user, with the same name as her loginname. If the variable is set to <i>no<\/i> (or <b>\u2212N\/\u2212\u2212no\u2212user\u2212group<\/b> is specified on the command line), useradd will set the primary group of the new user to the value specified by the <b>GROUP<\/b> variable in \/etc\/default\/useradd, or 100 by default.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>\u2212G<\/b>, <b>\u2212\u2212groups\u00a0<\/b><i>GROUP1<\/i>[<i>,GROUP2,&#8230;<\/i>[<i>,GROUPN<\/i>]]]<\/p>\n<p style=\"margin-left:17%;\">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 <b>\u2212g<\/b> option. The default is for the user to belong only to the initial group.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>\u2212h<\/b>, <b>\u2212\u2212help<\/b><\/p>\n<p style=\"margin-left:17%;\">Display help message and exit.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>\u2212k<\/b>, <b>\u2212\u2212skel\u00a0<\/b><i>SKEL_DIR<\/i><\/p>\n<p style=\"margin-left:17%;\">The skeleton directory, which contains files and directories to be copied in the user&#8217;s home directory, when the home directory is created by <b>useradd<\/b>.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">This option is only valid if the <b>\u2212m<\/b> (or <b>\u2212\u2212create\u2212home<\/b>) option is specified.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">If this option is not set, the skeleton directory is defined by the <b>SKEL<\/b> variable in \/etc\/default\/useradd or, by default, \/etc\/skel.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">If possible, the ACLs and extended attributes are copied.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>\u2212K<\/b>, <b>\u2212\u2212key\u00a0<\/b><i>KEY<\/i>=<i>VALUE<\/i><\/p>\n<p style=\"margin-left:17%;\">Overrides \/etc\/login.defs defaults (<b>UID_MIN<\/b>, <b>UID_MAX<\/b>, <b>UMASK<\/b>, <b>PASS_MAX_DAYS<\/b> and others).<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">Example: <b>\u2212K\u00a0<\/b><i>PASS_MAX_DAYS<\/i>=<i>\u22121<\/i> can be used when creating system account to turn off password aging, even though system account has no password at all. Multiple <b>\u2212K<\/b> options can be specified, e.g.: <b>\u2212K\u00a0<\/b><i>UID_MIN<\/i>=<i>100\u00a0<\/i> <b>\u2212K\u00a0<\/b><i>UID_MAX<\/i>=<i>499<\/i><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>\u2212l<\/b>, <b>\u2212\u2212no\u2212log\u2212init<\/b><\/p>\n<p style=\"margin-left:17%;\">Do not add the user to the lastlog and faillog databases.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">By default, the user&#8217;s entries in the lastlog and faillog databases are reset to avoid reusing the entry from a previously deleted user.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>\u2212m<\/b>, <b>\u2212\u2212create\u2212home<\/b><\/p>\n<p style=\"margin-left:17%;\">Create the user&#8217;s home directory if it does not exist. The files and directories contained in the skeleton directory (which can be defined with the <b>\u2212k<\/b> option) will be copied to the home directory.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">By default, if this option is not specified and <b>CREATE_HOME<\/b> is not enabled, no home directories are created.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>\u2212M<\/b>, <b>\u2212\u2212no\u2212create\u2212home<\/b><\/p>\n<p style=\"margin-left:17%;\">Do no create the user&#8217;s home directory, even if the system wide setting from \/etc\/login.defs (<b>CREATE_HOME<\/b>) is set to <i>yes<\/i>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>\u2212N<\/b>, <b>\u2212\u2212no\u2212user\u2212group<\/b><\/p>\n<p style=\"margin-left:17%;\">Do not create a group with the same name as the user, but add the user to the group specified by the <b>\u2212g<\/b> option or by the <b>GROUP<\/b> variable in \/etc\/default\/useradd.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">The default behavior (if the <b>\u2212g<\/b>, <b>\u2212N<\/b>, and <b>\u2212U<\/b> options are not specified) is defined by the <b>USERGROUPS_ENAB<\/b> variable in \/etc\/login.defs.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>\u2212o<\/b>, <b>\u2212\u2212non\u2212unique<\/b><\/p>\n<p style=\"margin-left:17%;\">Allow the creation of a user account with a duplicate (non\u2212unique) UID.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">This option is only valid in combination with the <b>\u2212u<\/b> option.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>\u2212p<\/b>, <b>\u2212\u2212password\u00a0<\/b><i>PASSWORD<\/i><\/p>\n<p style=\"margin-left:17%;\">The encrypted password, as returned by <b>crypt<\/b>(3). The default is to disable the password.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><b>Note:<\/b> This option is not recommended because the password (or encrypted password) will be visible by users listing the processes.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">You should make sure the password respects the system&#8217;s password policy.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>\u2212r<\/b>, <b>\u2212\u2212system<\/b><\/p>\n<p style=\"margin-left:17%;\">Create a system account.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">System users will be created with no aging information in \/etc\/shadow, and their numeric identifiers are chosen in the <b>SYS_UID_MIN<\/b>\u2212<b>SYS_UID_MAX<\/b> range, defined in \/etc\/login.defs, instead of <b>UID_MIN<\/b>\u2212<b>UID_MAX<\/b> (and their <b>GID<\/b> counterparts for the creation of groups).<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">Note that <b>useradd<\/b> will not create a home directory for such a user, regardless of the default setting in \/etc\/login.defs (<b>CREATE_HOME<\/b>). You have to specify the <b>\u2212m<\/b> options if you want a home directory for a system account to be created.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>\u2212R<\/b>, <b>\u2212\u2212root\u00a0<\/b><i>CHROOT_DIR<\/i><\/p>\n<p style=\"margin-left:17%;\">Apply changes in the <i>CHROOT_DIR<\/i> directory and use the configuration files from the <i>CHROOT_DIR<\/i> directory.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>\u2212P<\/b>, <b>\u2212\u2212prefix\u00a0<\/b><i>PREFIX_DIR<\/i><\/p>\n<p style=\"margin-left:17%;\">Apply changes in the <i>PREFIX_DIR<\/i> directory and use the configuration files from the <i>PREFIX_DIR<\/i> directory. This option does not chroot and is intended for preparing a cross\u2212compilation target. Some limitations: NIS and LDAP users\/groups are not verified. PAM authentication is using the host files. No SELINUX support.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>\u2212s<\/b>, <b>\u2212\u2212shell\u00a0<\/b><i>SHELL<\/i><\/p>\n<p style=\"margin-left:17%;\">The name of the user&#8217;s login shell. The default is to leave this field blank, which causes the system to select the default login shell specified by the <b>SHELL<\/b> variable in \/etc\/default\/useradd, or an empty string by default.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>\u2212u<\/b>, <b>\u2212\u2212uid\u00a0<\/b><i>UID<\/i><\/p>\n<p style=\"margin-left:17%;\">The numerical value of the user&#8217;s ID. This value must be unique, unless the <b>\u2212o<\/b> option is used. The value must be non\u2212negative. The default is to use the smallest ID value greater than or equal to <b>UID_MIN<\/b> and greater than every other user.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">See also the <b>\u2212r<\/b> option and the <b>UID_MAX<\/b> description.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>\u2212U<\/b>, <b>\u2212\u2212user\u2212group<\/b><\/p>\n<p style=\"margin-left:17%;\">Create a group with the same name as the user, and add the user to this group.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">The default behavior (if the <b>\u2212g<\/b>, <b>\u2212N<\/b>, and <b>\u2212U<\/b> options are not specified) is defined by the <b>USERGROUPS_ENAB<\/b> variable in \/etc\/login.defs.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>\u2212Z<\/b>, <b>\u2212\u2212selinux\u2212user\u00a0<\/b><i>SEUSER<\/i><\/p>\n<p style=\"margin-left:17%;\">The SELinux user for the user&#8217;s login. The default is to leave this field blank, which causes the system to select the default SELinux user.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Changing the default values<\/b> <br \/> When invoked with only the <b>\u2212D<\/b> option, <b>useradd<\/b> will display the current default values. When invoked with <b>\u2212D<\/b> plus other options, <b>useradd<\/b> will update the default values for the specified options. Valid default\u2212changing options are:<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>\u2212b<\/b>, <b>\u2212\u2212base\u2212dir\u00a0<\/b><i>BASE_DIR<\/i><\/p>\n<p style=\"margin-left:17%;\">The path prefix for a new user&#8217;s home directory. The user&#8217;s name will be affixed to the end of <i>BASE_DIR<\/i> to form the new user&#8217;s home directory name, if the <b>\u2212d<\/b> option is not used when creating a new account.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">This option sets the <b>HOME<\/b> variable in \/etc\/default\/useradd.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>\u2212e<\/b>, <b>\u2212\u2212expiredate\u00a0<\/b><i>EXPIRE_DATE<\/i><\/p>\n<p style=\"margin-left:17%;\">The date on which the user account is disabled.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">This option sets the <b>EXPIRE<\/b> variable in \/etc\/default\/useradd.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>\u2212f<\/b>, <b>\u2212\u2212inactive\u00a0<\/b><i>INACTIVE<\/i><\/p>\n<p style=\"margin-left:17%;\">The number of days after a password has expired before the account will be disabled.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">This option sets the <b>INACTIVE<\/b> variable in \/etc\/default\/useradd.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>\u2212g<\/b>, <b>\u2212\u2212gid\u00a0<\/b><i>GROUP<\/i><\/p>\n<p style=\"margin-left:17%;\">The group name or ID for a new user&#8217;s initial group (when the <b>\u2212N\/\u2212\u2212no\u2212user\u2212group<\/b> is used or when the <b>USERGROUPS_ENAB<\/b> variable is set to <i>no<\/i> in \/etc\/login.defs). The named group must exist, and a numerical group ID must have an existing entry.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">This option sets the <b>GROUP<\/b> variable in \/etc\/default\/useradd.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>\u2212s<\/b>, <b>\u2212\u2212shell\u00a0<\/b><i>SHELL<\/i><\/p>\n<p style=\"margin-left:17%;\">The name of a new user&#8217;s login shell.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">This option sets the <b>SHELL<\/b> variable in \/etc\/default\/useradd.<\/p>\n<h2>NOTES <a name=\"NOTES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The system administrator is responsible for placing the default user files in the \/etc\/skel\/ directory (or any other skeleton directory specified in \/etc\/default\/useradd or on the command line).<\/p>\n<h2>CAVEATS <a name=\"CAVEATS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">You may not add a user to a NIS or LDAP group. This must be performed on the corresponding server.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Similarly, if the username already exists in an external user database such as NIS or LDAP, <b>useradd<\/b> will deny the user account creation request.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Usernames must start with a lower case letter or an underscore, followed by lower case letters, digits, underscores, or dashes. They can end with a dollar sign. In regular expression terms: [a\u2212z_][a\u2212z0\u22129_\u2212]*[$]?<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Usernames may only be up to 32 characters long.<\/p>\n<h2>CONFIGURATION <a name=\"CONFIGURATION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The following configuration variables in \/etc\/login.defs change the behavior of this tool:<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>CREATE_HOME<\/b> (boolean)<\/p>\n<p style=\"margin-left:17%;\">Indicate if a home directory should be created by default for new users.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">This setting does not apply to system users, and can be overridden on the command line.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>GID_MAX<\/b> (number), <b>GID_MIN<\/b> (number)<\/p>\n<p style=\"margin-left:17%;\">Range of group IDs used for the creation of regular groups by <b>useradd<\/b>, <b>groupadd<\/b>, or <b>newusers<\/b>.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">The default value for <b>GID_MIN<\/b> (resp. <b>GID_MAX<\/b>) is 1000 (resp. 60000).<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>MAIL_DIR<\/b> (string)<\/p>\n<p style=\"margin-left:17%;\">The mail spool directory. This is needed to manipulate the mailbox when its corresponding user account is modified or deleted. If not specified, a compile\u2212time default is used.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>MAIL_FILE<\/b> (string)<\/p>\n<p style=\"margin-left:17%;\">Defines the location of the users mail spool files relatively to their home directory.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <b>MAIL_DIR<\/b> and <b>MAIL_FILE<\/b> variables are used by <b>useradd<\/b>, <b>usermod<\/b>, and <b>userdel<\/b> to create, move, or delete the user&#8217;s mail spool.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">If <b>MAIL_CHECK_ENAB<\/b> is set to <i>yes<\/i>, they are also used to define the <b>MAIL<\/b> environment variable.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>MAX_MEMBERS_PER_GROUP<\/b> (number)<\/p>\n<p style=\"margin-left:17%;\">Maximum members per group entry. When the maximum is reached, a new group entry (line) is started in \/etc\/group (with the same name, same password, and same GID).<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">The default value is 0, meaning that there are no limits in the number of members in a group.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">This feature (split group) permits to limit the length of lines in the group file. This is useful to make sure that lines for NIS groups are not larger than 1024 characters.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">If you need to enforce such limit, you can use 25.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">Note: split groups may not be supported by all tools (even in the Shadow toolsuite). You should not use this variable unless you really need it.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>PASS_MAX_DAYS<\/b> (number)<\/p>\n<p style=\"margin-left:17%;\">The maximum number of days a password may be used. If the password is older than this, a password change will be forced. If not specified, \u22121 will be assumed (which disables the restriction).<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>PASS_MIN_DAYS<\/b> (number)<\/p>\n<p style=\"margin-left:17%;\">The minimum number of days allowed between password changes. Any password changes attempted sooner than this will be rejected. If not specified, \u22121 will be assumed (which disables the restriction).<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>PASS_WARN_AGE<\/b> (number)<\/p>\n<p style=\"margin-left:17%;\">The number of days warning given before a password expires. A zero means warning is given only upon the day of expiration, a negative value means no warning is given. If not specified, no warning will be provided.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>SUB_GID_MIN<\/b> (number), <b>SUB_GID_MAX<\/b> (number), <b>SUB_GID_COUNT<\/b> (number)<\/p>\n<p style=\"margin-left:17%;\">If \/etc\/subuid exists, the commands <b>useradd<\/b> and <b>newusers<\/b> (unless the user already have subordinate group IDs) allocate <b>SUB_GID_COUNT<\/b> unused group IDs from the range <b>SUB_GID_MIN<\/b> to <b>SUB_GID_MAX<\/b> for each new user.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">The default values for <b>SUB_GID_MIN<\/b>, <b>SUB_GID_MAX<\/b>, <b>SUB_GID_COUNT<\/b> are respectively 100000, 600100000 and 10000.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>SUB_UID_MIN<\/b> (number), <b>SUB_UID_MAX<\/b> (number), <b>SUB_UID_COUNT<\/b> (number)<\/p>\n<p style=\"margin-left:17%;\">If \/etc\/subuid exists, the commands <b>useradd<\/b> and <b>newusers<\/b> (unless the user already have subordinate user IDs) allocate <b>SUB_UID_COUNT<\/b> unused user IDs from the range <b>SUB_UID_MIN<\/b> to <b>SUB_UID_MAX<\/b> for each new user.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">The default values for <b>SUB_UID_MIN<\/b>, <b>SUB_UID_MAX<\/b>, <b>SUB_UID_COUNT<\/b> are respectively 100000, 600100000 and 10000.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>SYS_GID_MAX<\/b> (number), <b>SYS_GID_MIN<\/b> (number)<\/p>\n<p style=\"margin-left:17%;\">Range of group IDs used for the creation of system groups by <b>useradd<\/b>, <b>groupadd<\/b>, or <b>newusers<\/b>.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">The default value for <b>SYS_GID_MIN<\/b> (resp. <b>SYS_GID_MAX<\/b>) is 101 (resp. <b>GID_MIN<\/b>\u22121).<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>SYS_UID_MAX<\/b> (number), <b>SYS_UID_MIN<\/b> (number)<\/p>\n<p style=\"margin-left:17%;\">Range of user IDs used for the creation of system users by <b>useradd<\/b> or <b>newusers<\/b>.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">The default value for <b>SYS_UID_MIN<\/b> (resp. <b>SYS_UID_MAX<\/b>) is 101 (resp. <b>UID_MIN<\/b>\u22121).<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>UID_MAX<\/b> (number), <b>UID_MIN<\/b> (number)<\/p>\n<p style=\"margin-left:17%;\">Range of user IDs used for the creation of regular users by <b>useradd<\/b> or <b>newusers<\/b>.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">The default value for <b>UID_MIN<\/b> (resp. <b>UID_MAX<\/b>) is 1000 (resp. 60000).<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>UMASK<\/b> (number)<\/p>\n<p style=\"margin-left:17%;\">The file mode creation mask is initialized to this value. If not specified, the mask will be initialized to 022.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><b>useradd<\/b> and <b>newusers<\/b> use this mask to set the mode of the home directory they create<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">It is also used by <b>login<\/b> to define users&#8217; initial umask. Note that this mask can be overridden by the user&#8217;s GECOS line (if <b>QUOTAS_ENAB<\/b> is set) or by the specification of a limit with the <i>K<\/i> identifier in <b>limits<\/b>(5).<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>USERGROUPS_ENAB<\/b> (boolean)<\/p>\n<p style=\"margin-left:17%;\">Enable setting of the umask group bits to be the same as owner bits (examples: 022 \u2212> 002, 077 \u2212> 007) for non\u2212root users, if the uid is the same as gid, and username is the same as the primary group name.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">If set to <i>yes<\/i>, <b>userdel<\/b> will remove the user&#8217;s group if it contains no more members, and <b>useradd<\/b> will create by default a group with the name of the user.<\/p>\n<h2>FILES <a name=\"FILES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">\/etc\/passwd<\/p>\n<p style=\"margin-left:17%;\">User account information.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">\/etc\/shadow<\/p>\n<p style=\"margin-left:17%;\">Secure user account information.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">\/etc\/group<\/p>\n<p style=\"margin-left:17%;\">Group account information.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">\/etc\/gshadow<\/p>\n<p style=\"margin-left:17%;\">Secure group account information.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">\/etc\/default\/useradd<\/p>\n<p style=\"margin-left:17%;\">Default values for account creation.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">\/etc\/skel\/<\/p>\n<p style=\"margin-left:17%;\">Directory containing default files.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">\/etc\/subgid<\/p>\n<p style=\"margin-left:17%;\">Per user subordinate group IDs.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">\/etc\/subuid<\/p>\n<p style=\"margin-left:17%;\">Per user subordinate user IDs.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">\/etc\/login.defs<\/p>\n<p style=\"margin-left:17%;\">Shadow password suite configuration.<\/p>\n<h2>EXIT VALUES <a name=\"EXIT VALUES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The <b>useradd<\/b> command exits with the following values:<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><i>0<\/i><\/p>\n<p style=\"margin-left:17%;\">success<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><i>1<\/i><\/p>\n<p style=\"margin-left:17%;\">can&#8217;t update password file<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><i>2<\/i><\/p>\n<p style=\"margin-left:17%;\">invalid command syntax<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><i>3<\/i><\/p>\n<p style=\"margin-left:17%;\">invalid argument to option<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><i>4<\/i><\/p>\n<p style=\"margin-left:17%;\">UID already in use (and no <b>\u2212o<\/b>)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><i>6<\/i><\/p>\n<p style=\"margin-left:17%;\">specified group doesn&#8217;t exist<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><i>9<\/i><\/p>\n<p style=\"margin-left:17%;\">username already in use<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><i>10<\/i><\/p>\n<p style=\"margin-left:17%;\">can&#8217;t update group file<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><i>12<\/i><\/p>\n<p style=\"margin-left:17%;\">can&#8217;t create home directory<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><i>14<\/i><\/p>\n<p style=\"margin-left:17%;\">can&#8217;t update SELinux user mapping<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>chfn<\/b>(1), <b>chsh<\/b>(1), <b>passwd<\/b>(1), <b>crypt<\/b>(3), <b>groupadd<\/b>(8), <b>groupdel<\/b>(8), <b>groupmod<\/b>(8), <b>login.defs<\/b>(5), <b>newusers<\/b>(8), <b>subgid<\/b>(5), <b>subuid<\/b>(5), <b>userdel<\/b>(8), <b>usermod<\/b>(8).<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  useradd \u2212 create a new user or update default new user information <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[5,52,4,932],"class_list":["post-3836","post","type-post","status-publish","format-standard","hentry","category-8-administracion-del-sistema","tag-5","tag-administracion","tag-man8","tag-useradd"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3836","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=3836"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3836\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=3836"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=3836"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=3836"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}