{
    "content": [
        {
            "type": "text",
            "text": "# newusers (man)\n\n## NAME\n\nnewusers - update and create new users in batch\n\n## SYNOPSIS\n\nnewusers [options] [file]\n\n## DESCRIPTION\n\nThe newusers command reads a file (or the standard input by default) and uses this\ninformation to update a set of existing users or to create new users. Each line is in the\nsame format as the standard password file (see passwd(5)) with the exceptions explained\nbelow:\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **OPTIONS** (4 subsections)\n- **CAVEATS**\n- **CONFIGURATION** (12 subsections)\n- **FILES**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "newusers",
        "section": "",
        "mode": "man",
        "summary": "newusers - update and create new users in batch",
        "synopsis": "newusers [options] [file]",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [
            {
                "flag": "",
                "long": "--badname",
                "arg": null,
                "description": "Allow names that do not conform to standards."
            },
            {
                "flag": "-h",
                "long": "--help",
                "arg": null,
                "description": "Display help message and exit."
            },
            {
                "flag": "-r",
                "long": "--system",
                "arg": null,
                "description": "Create a system account. System users will be created with no aging information in /etc/shadow, and their numeric identifiers are chosen in the SYSUIDMIN-SYSUIDMAX range, defined in login.defs, instead of UIDMIN-UIDMAX (and their GID counterparts for the creation of groups)."
            },
            {
                "flag": "-R",
                "long": "--root",
                "arg": null,
                "description": "Apply changes in the CHROOTDIR directory and use the configuration files from the CHROOTDIR directory."
            }
        ],
        "examples": [],
        "see_also": [
            {
                "name": "login.defs",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/login.defs/5/json"
            },
            {
                "name": "passwd",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/passwd/1/json"
            },
            {
                "name": "subgid",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/subgid/5/json"
            },
            {
                "name": "subuid",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/subuid/5/json"
            },
            {
                "name": "useradd",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/useradd/8/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 76,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 2,
                "subsections": [
                    {
                        "name": "--badname",
                        "lines": 2,
                        "long": "--badname"
                    },
                    {
                        "name": "-h --help",
                        "lines": 2,
                        "flag": "-h",
                        "long": "--help"
                    },
                    {
                        "name": "-r --system",
                        "lines": 6,
                        "flag": "-r",
                        "long": "--system"
                    },
                    {
                        "name": "-R --root",
                        "lines": 3,
                        "flag": "-R",
                        "long": "--root"
                    }
                ]
            },
            {
                "name": "CAVEATS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "CONFIGURATION",
                "lines": 2,
                "subsections": [
                    {
                        "name": "GID___MAX (number), GID___MIN (number)",
                        "lines": 5
                    },
                    {
                        "name": "HOME___MODE (number)",
                        "lines": 5
                    },
                    {
                        "name": "MAX___MEMBERS___PER___GROUP (number)",
                        "lines": 14
                    },
                    {
                        "name": "PASS___MAX___DAYS (number)",
                        "lines": 4
                    },
                    {
                        "name": "PASS___MIN___DAYS (number)",
                        "lines": 4
                    },
                    {
                        "name": "PASS___WARN___AGE (number)",
                        "lines": 4
                    },
                    {
                        "name": "SUB___GID___MIN (number), SUB___GID___MAX (number), SUB___GID___COUNT (number)",
                        "lines": 7
                    },
                    {
                        "name": "SUB___UID___MIN (number), SUB___UID___MAX (number), SUB___UID___COUNT (number)",
                        "lines": 7
                    },
                    {
                        "name": "SYS___GID___MAX (number), SYS___GID___MIN (number)",
                        "lines": 5
                    },
                    {
                        "name": "SYS___UID___MAX (number), SYS___UID___MIN (number)",
                        "lines": 4
                    },
                    {
                        "name": "UID___MAX (number), UID___MIN (number)",
                        "lines": 4
                    },
                    {
                        "name": "UMASK (number)",
                        "lines": 8
                    }
                ]
            },
            {
                "name": "FILES",
                "lines": 24,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "newusers - update and create new users in batch\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "newusers [options] [file]\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "The newusers command reads a file (or the standard input by default) and uses this\ninformation to update a set of existing users or to create new users. Each line is in the\nsame format as the standard password file (see passwd(5)) with the exceptions explained\nbelow:\n\npwname:pwpasswd:pwuid:pwgid:pwgecos:pwdir:pwshell\n\npwname\nThis is the name of the user.\n\nIt can be the name of a new user or the name of an existing user (or a user created\nbefore by newusers). In case of an existing user, the user's information will be changed,\notherwise a new user will be created.\n\npwpasswd\nThis field will be encrypted and used as the new value of the encrypted password.\n\npwuid\nThis field is used to define the UID of the user.\n\nIf the field is empty, a new (unused) UID will be defined automatically by newusers.\n\nIf this field contains a number, this number will be used as the UID.\n\nIf this field contains the name of an existing user (or the name of a user created before\nby newusers), the UID of the specified user will be used.\n\nIf the UID of an existing user is changed, the files ownership of the user's file should\nbe fixed manually.\n\npwgid\nThis field is used to define the primary group ID for the user.\n\nIf this field contains the name of an existing group (or a group created before by\nnewusers), the GID of this group will be used as the primary group ID for the user.\n\nIf this field is a number, this number will be used as the primary group ID of the user.\nIf no groups exist with this GID, a new group will be created with this GID, and the name\nof the user.\n\nIf this field is empty, a new group will be created with the name of the user and a GID\nwill be automatically defined by newusers to be used as the primary group ID for the user\nand as the GID for the new group.\n\nIf this field contains the name of a group which does not exist (and was not created\nbefore by newusers), a new group will be created with the specified name and a GID will\nbe automatically defined by newusers to be used as the primary group ID for the user and\nGID for the new group.\n\npwgecos\nThis field is copied in the GECOS field of the user.\n\npwdir\nThis field is used to define the home directory of the user.\n\nIf this field does not specify an existing directory, the specified directory is created,\nwith ownership set to the user being created or updated and its primary group.\n\nIf the home directory of an existing user is changed, newusers does not move or copy the\ncontent of the old directory to the new location. This should be done manually.\n\npwshell\nThis field defines the shell of the user. No checks are performed on this field.\n\nnewusers first tries to create or change all the specified users, and then write these\nchanges to the user or group databases. If an error occurs (except in the final writes to the\ndatabases), no changes are committed to the databases.\n\nDuring this first pass, users are created with a locked password (and passwords are not\nchanged for the users which are not created). A second pass is used to update the passwords\nusing PAM. Failures to update a password are reported, but will not stop the other password\nupdates.\n\nThis command is intended to be used in a large system environment where many accounts are\nupdated at a single time.\n",
                "subsections": []
            },
            "OPTIONS": {
                "content": "The options which apply to the newusers command are:\n",
                "subsections": [
                    {
                        "name": "--badname",
                        "content": "Allow names that do not conform to standards.\n",
                        "long": "--badname"
                    },
                    {
                        "name": "-h --help",
                        "content": "Display help message and exit.\n",
                        "flag": "-h",
                        "long": "--help"
                    },
                    {
                        "name": "-r --system",
                        "content": "Create a system account.\n\nSystem users will be created with no aging information in /etc/shadow, and their numeric\nidentifiers are chosen in the SYSUIDMIN-SYSUIDMAX range, defined in login.defs,\ninstead of UIDMIN-UIDMAX (and their GID counterparts for the creation of groups).\n",
                        "flag": "-r",
                        "long": "--system"
                    },
                    {
                        "name": "-R --root",
                        "content": "Apply changes in the CHROOTDIR directory and use the configuration files from the\nCHROOTDIR directory.\n",
                        "flag": "-R",
                        "long": "--root"
                    }
                ]
            },
            "CAVEATS": {
                "content": "The input file must be protected since it contains unencrypted passwords.\n",
                "subsections": []
            },
            "CONFIGURATION": {
                "content": "The following configuration variables in /etc/login.defs change the behavior of this tool:\n",
                "subsections": [
                    {
                        "name": "GID___MAX (number), GID___MIN (number)",
                        "content": "Range of group IDs used for the creation of regular groups by useradd, groupadd, or\nnewusers.\n\nThe default value for GIDMIN (resp.  GIDMAX) is 1000 (resp. 60000).\n"
                    },
                    {
                        "name": "HOME___MODE (number)",
                        "content": "The mode for new home directories. If not specified, the UMASK is used to create the\nmode.\n\nuseradd and newusers use this to set the mode of the home directory they create.\n"
                    },
                    {
                        "name": "MAX___MEMBERS___PER___GROUP (number)",
                        "content": "Maximum members per group entry. When the maximum is reached, a new group entry (line) is\nstarted in /etc/group (with the same name, same password, and same GID).\n\nThe default value is 0, meaning that there are no limits in the number of members in a\ngroup.\n\nThis feature (split group) permits to limit the length of lines in the group file. This\nis useful to make sure that lines for NIS groups are not larger than 1024 characters.\n\nIf you need to enforce such limit, you can use 25.\n\nNote: split groups may not be supported by all tools (even in the Shadow toolsuite). You\nshould not use this variable unless you really need it.\n"
                    },
                    {
                        "name": "PASS___MAX___DAYS (number)",
                        "content": "The maximum number of days a password may be used. If the password is older than this, a\npassword change will be forced. If not specified, -1 will be assumed (which disables the\nrestriction).\n"
                    },
                    {
                        "name": "PASS___MIN___DAYS (number)",
                        "content": "The minimum number of days allowed between password changes. Any password changes\nattempted sooner than this will be rejected. If not specified, -1 will be assumed (which\ndisables the restriction).\n"
                    },
                    {
                        "name": "PASS___WARN___AGE (number)",
                        "content": "The number of days warning given before a password expires. A zero means warning is given\nonly upon the day of expiration, a negative value means no warning is given. If not\nspecified, no warning will be provided.\n"
                    },
                    {
                        "name": "SUB___GID___MIN (number), SUB___GID___MAX (number), SUB___GID___COUNT (number)",
                        "content": "If /etc/subuid exists, the commands useradd and newusers (unless the user already have\nsubordinate group IDs) allocate SUBGIDCOUNT unused group IDs from the range SUBGIDMIN\nto SUBGIDMAX for each new user.\n\nThe default values for SUBGIDMIN, SUBGIDMAX, SUBGIDCOUNT are respectively 100000,\n600100000 and 65536.\n"
                    },
                    {
                        "name": "SUB___UID___MIN (number), SUB___UID___MAX (number), SUB___UID___COUNT (number)",
                        "content": "If /etc/subuid exists, the commands useradd and newusers (unless the user already have\nsubordinate user IDs) allocate SUBUIDCOUNT unused user IDs from the range SUBUIDMIN\nto SUBUIDMAX for each new user.\n\nThe default values for SUBUIDMIN, SUBUIDMAX, SUBUIDCOUNT are respectively 100000,\n600100000 and 65536.\n"
                    },
                    {
                        "name": "SYS___GID___MAX (number), SYS___GID___MIN (number)",
                        "content": "Range of group IDs used for the creation of system groups by useradd, groupadd, or\nnewusers.\n\nThe default value for SYSGIDMIN (resp.  SYSGIDMAX) is 101 (resp.  GIDMIN-1).\n"
                    },
                    {
                        "name": "SYS___UID___MAX (number), SYS___UID___MIN (number)",
                        "content": "Range of user IDs used for the creation of system users by useradd or newusers.\n\nThe default value for SYSUIDMIN (resp.  SYSUIDMAX) is 101 (resp.  UIDMIN-1).\n"
                    },
                    {
                        "name": "UID___MAX (number), UID___MIN (number)",
                        "content": "Range of user IDs used for the creation of regular users by useradd or newusers.\n\nThe default value for UIDMIN (resp.  UIDMAX) is 1000 (resp. 60000).\n"
                    },
                    {
                        "name": "UMASK (number)",
                        "content": "The file mode creation mask is initialized to this value. If not specified, the mask will\nbe initialized to 022.\n\nuseradd and newusers use this mask to set the mode of the home directory they create if\nHOMEMODE is not set.\n\nIt is also used by pamumask as the default umask value.\n"
                    }
                ]
            },
            "FILES": {
                "content": "/etc/passwd\nUser account information.\n\n/etc/shadow\nSecure user account information.\n\n/etc/group\nGroup account information.\n\n/etc/gshadow\nSecure group account information.\n\n/etc/login.defs\nShadow password suite configuration.\n\n/etc/pam.d/newusers\nPAM configuration for newusers.\n\n/etc/subgid\nPer user subordinate group IDs.\n\n/etc/subuid\nPer user subordinate user IDs.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "login.defs(5), passwd(1), subgid(5), subuid(5), useradd(8).\n\n\n\nshadow-utils 4.8.1                           02/06/2024                                  NEWUSERS(8)",
                "subsections": []
            }
        }
    }
}