OS Manuals

/usr/bin/useradd

PAM login and passwd utilities

From shadow 4.20.3-r3 (os), captured 2026-11-05 by running useradd --help (exit 0). permalink

Usage: useradd [options] LOGIN
       useradd -D
       useradd -D [options]

Options:
      --badname                 do not check for bad names
  -b, --base-dir BASE_DIR       base directory for the home directory of the
                                new account
      --btrfs-subvolume-home    use BTRFS subvolume for home directory
  -c, --comment COMMENT         GECOS field of the new account
  -d, --home-dir HOME_DIR       home directory of the new account
  -D, --defaults                print or change default useradd configuration
  -e, --expiredate EXPIRE_DATE  expiration date of the new account
  -f, --inactive INACTIVE       password inactivity period of the new account
  -F, --add-subids-for-system   add entries to sub[ug]id even when adding a system user
  -g, --gid GROUP               name or ID of the primary group of the new
                                account
  -G, --groups GROUPS           list of supplementary groups of the new
                                account
  -h, --help                    display this help message and exit
  -k, --skel SKEL_DIR           use this alternative skeleton directory
  -K, --key KEY=VALUE           override /etc/login.defs defaults
  -l, --no-log-init             do not add the user to the lastlog and
                                faillog databases
  -m, --create-home             create the user's home directory
  -M, --no-create-home          do not create the user's home directory
  -N, --no-user-group           do not create a group with the same name as
                                the user
  -o, --non-unique              allow to create users with duplicate
                                (non-unique) UID
  -p, --password PASSWORD       encrypted password of the new account
  -r, --system                  create a system account
  -R, --root CHROOT_DIR         directory to chroot into
  -P, --prefix PREFIX_DIR       prefix directory where are located the /etc/* files
  -s, --shell SHELL             login shell of the new account
  -u, --uid UID                 user ID of the new account
  -U, --user-group              create a group with the same name as the user
  -Z, --selinux-user SEUSER     use a specific SEUSER for the SELinux user mapping
      --selinux-range SERANGE   use a specific MLS range for the SELinux user mapping
Options (28)
OptionDescriptionSource
--badnamedo not check for bad nameshelp
-b, --base-dir BASE_DIRbase directory for the home directory of the new accounthelp
--btrfs-subvolume-homeuse BTRFS subvolume for home directoryhelp
-c, --comment COMMENTGECOS field of the new accounthelp
-d, --home-dir HOME_DIRhome directory of the new accounthelp
-D, --defaultsprint or change default useradd configurationhelp
-e, --expiredate EXPIRE_DATEexpiration date of the new accounthelp
-f, --inactive INACTIVEpassword inactivity period of the new accounthelp
-F, --add-subids-for-systemadd entries to sub[ug]id even when adding a system userhelp
-g, --gid GROUPname or ID of the primary group of the new accounthelp
-G, --groups GROUPSlist of supplementary groups of the new accounthelp
-h, --helpdisplay this help message and exithelp
-k, --skel SKEL_DIRuse this alternative skeleton directoryhelp
-K, --key KEY=VALUEoverride /etc/login.defs defaultshelp
-l, --no-log-initdo not add the user to the lastlog and faillog databaseshelp
-m, --create-homecreate the user's home directoryhelp
-M, --no-create-homedo not create the user's home directoryhelp
-N, --no-user-groupdo not create a group with the same name as the userhelp
-o, --non-uniqueallow to create users with duplicate (non-unique) UIDhelp
-p, --password PASSWORDencrypted password of the new accounthelp
-r, --systemcreate a system accounthelp
-R, --root CHROOT_DIRdirectory to chroot intohelp
-P, --prefix PREFIX_DIRprefix directory where are located the /etc/* fileshelp
-s, --shell SHELLlogin shell of the new accounthelp
-u, --uid UIDuser ID of the new accounthelp
-U, --user-groupcreate a group with the same name as the userhelp
-Z, --selinux-user SEUSERuse a specific SEUSER for the SELinux user mappinghelp
--selinux-range SERANGEuse a specific MLS range for the SELinux user mappinghelp

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.