ADDUSER.CONF(5)

๐Ÿ’– ADDUSER.CONF(5) ๐Ÿ’–

okay so bestie, buckle up โ€” this is the manual page for /etc/adduser.conf, living in the File Formats Manual section (ADDUSER.CONF(5), iykyk). it's the little file that runs the whole vibe for a bunch of user-management tools, and we're gonna read it together. no cap. ๐Ÿซถ


โœจ NAME โœจ

/etc/adduser.conf โ€” the configuration file for adduser(8) and addgroup(8). that's it, that's the name. iconic.


๐ŸŒธ DESCRIPTION ๐ŸŒธ

so <hotpink>/etc/adduser.conf holds all the defaults for adduser(8), addgroup(8), deluser(8) and delgroup(8). four programs, one config file, main character energy fr fr. ๐Ÿ’…

the formatting rules are lowkey simple:

  • every line is a single value pair, shaped like option = value.
  • you're allowed to wrap the value in double quotes or single quotes โ€” your call, both slay.
  • whitespace around the equals sign? totally fine, go off.
  • comment lines must have a hash sign (#) in the very first column. first column only, bestie, don't try to be sneaky.

and now, the valid configuration options โ€” there are a LOT, so hydrate and let's go ๐ŸŒˆ:

  • STDERRMSGLEVEL, STDOUTMSGLEVEL, and LOGMSGLEVEL โ€” the minimum priority for messages logged to syslog/journal and the console, respectively. peep LOGGING in adduser(8) for the deets. defaults to warn for STDOUTMSGLEVEL and STDERRMSGLEVEL, and info for LOGMSGLEVEL.
  • ADD_EXTRA_GROUPS โ€” set this to literally anything other than 0 and adduser will drop newly created non-system users into the group list defined by EXTRA_GROUPS (right below). defaults to 0.
  • DIR_MODE โ€” the permissions mode for home directories of non-system users made by adduser(8). defaults to 0700. โš ๏ธ heads up: there are potential configurations (think ~/user web services, or in-home mail delivery) that will require you to change the default. see also SYS_DIR_MODE.
  • DHOME โ€” the directory where all the new home directories get created. defaults to /home. ๐Ÿ 
  • DSHELL โ€” the login shell used for all new users. defaults to /bin/bash. ๐Ÿš
  • EXTRA_GROUPS โ€” the space-separated list of groups that new non-system users get added to. defaults to users.
  • FIRST_SYSTEM_GID and LAST_SYSTEM_GID โ€” specify an inclusive range of GIDs that system groups can be dynamically allocated from. defaults to 100 - 999.
  • FIRST_GID and LAST_GID โ€” specify an inclusive range of GIDs that non-system groups can be dynamically allocated from. defaults to 1000 - 59999.
  • FIRST_SYSTEM_UID and LAST_SYSTEM_UID โ€” specify an inclusive range of UIDs that system users can be dynamically allocated from. defaults to 100 - 999. ๐Ÿ’€ please note: system software โ€” like the users allocated by the base-passwd package โ€” may assume that UIDs less than 100 are unallocated. so don't get cute down there.
  • FIRST_UID and LAST_UID โ€” specify an inclusive range of UIDs that non-system users can be dynamically allocated from. defaults to 1000 - 59999.
  • GID_POOL โ€” see UID_POOL. (they're a package deal, your honor ๐ŸŽ€)
  • LAST_SYSTEM_GID, LAST_GID, LAST_SYSTEM_UID, LAST_UID โ€” see the FIRST_ variants of the option. yeah, they get their own listing, we don't make the rules.
  • NAME_REGEX โ€” non-system user- and groupnames get checked against this regular expression. if the name doesn't match this regexp, user and group creation in adduser(8) is refused unless --allow-bad-names is set. with --allow-bad-names set, weaker checks are performed. defaults to the most conservative ^[a-zA-Z][a-zA-Z0-9_-]*\$?$. see SYS_NAME_REGEX and Valid names, below, for more info. ๐Ÿ”ฅ
  • RESERVE_UID_POOL and RESERVE_GID_POOL โ€” controls whether the UID and GID values listed in the pool files are truly reserved. see UID AND GID POOLS in the NOTES section. defaults to yes.
  • SKEL โ€” the directory that skeletal user configuration files get copied from. defaults to /etc/skel. ๐Ÿฆ‹
  • SKEL_IGNORE_REGEX โ€” when the newly created home directory of a non-system user gets populated, files in SKEL matching this regex are not copied. defaults to (.(dpkg|ucf)-(old|new|dist)$), the regex that matches files left over from unmerged config files.
  • SYS_DIR_MODE โ€” the permissions mode for home directories of system users created by adduser(8). defaults to 0755. โš ๏ธ note that changing the default permissions for system users may cause some packages to behave unreliably, if the program relies on the default setting. see also DIR_MODE.
  • SYS_NAME_REGEX โ€” system user- and groupnames get checked against this regular expression. if the name doesn't match this regexp, system user and group creation in adduser is refused unless --allow-bad-names is set. with --allow-bad-names set, weaker checks are performed. defaults to the most conservative ^[a-zA-Z_][a-zA-Z0-9_-]*\$?$. see NAME_REGEX, above, and Valid names, below, for more info.
  • UID_POOL and GID_POOL โ€” specify a file or a directory containing UID and GID pool files. see UID AND GID POOLS in the NOTES section. both default to empty.
  • USERGROUPS โ€” specifies whether each created non-system user gets given their own group to use. defaults to yes.
  • USERS_GID and USERS_GROUP โ€” defines the groupname or GID of the group that all newly-created non-system users get placed into. if USERGROUPS is yes, the group will be added as a supplementary group; if USERGROUPS is no, it will be the primary group. if you don't want all your users hanging out in one group, set USERGROUPS=yes, leave USERS_GROUP empty, and set USERS_GID to "-1". USERS_GROUP defaults to users, which has GID 100 on all Debian systems since it's defined statically by the base-passwd package. ๐Ÿšจ it is a configuration error to define both variables โ€” even if the values are consistent. pick one, bestie.

๐Ÿ“ NOTES ๐Ÿ“

๐Ÿ’œ UID AND GID POOLS ๐Ÿ’œ

some installations want a non-system account to come pre-loaded with preconfigured properties the moment it's generated. usually the local admin just wants to make sure that โ€” even without using a directory service โ€” an account or a group with a certain name ends up with the same numeric UID/GID on every system where it exists. consistency is the vibe. โœจ

to turn this feature on, define the config variables UID_POOL (for user accounts) and/or GID_POOL (for groups) in /etc/adduser.conf, then install the respective files in the configured places. the value is either a file or a directory. if it's a directory, all files named *.conf inside it get considered. ๐Ÿ‘‘

the file format is similar to /etc/passwd: text lines, with fields separated by a colon. the values are:

  1. username/groupname โ€” mandatory
  2. UID/GID โ€” mandatory
  3. comment field โ€” optional, useful for user IDs only
  4. home directory โ€” ditto
  5. shell โ€” ditto

you can use the same file/directory for both UID_POOL and GID_POOL. but you cannot copy lines from /etc/passwd or /etc/group, because pool file lines have fewer fields. so close, yet so far ๐Ÿ™ˆ.

when an account / group gets created, adduser(8) searches through all the UID/GID pool files for a line matching the name of the shiny new account, and uses the data it finds there to initialize the new account instead of using the defaults. settings may be overridden from the command line. ๐ŸŽ€

in the default configuration, the UID and GID values listed in the pool will be reserved, and thus won't be used by the normal UID and GID selection processes. that's usually exactly what you'd want. with the RESERVE_UID_POOL and RESERVE_GID_POOL configuration options, you can switch this behavior off if you want pooled UIDs and GIDs to be used by regular accounts. but heads up: this might cause conflicts, and it might cause your pool UIDs and GIDs to get used by accounts that are not in the pool. ๐Ÿ’€


๐Ÿ“‚ FILES ๐Ÿ“‚

  • /etc/adduser.conf

๐Ÿ‘€ SEE ALSO ๐Ÿ‘€

deluser.conf(5), addgroup(8), adduser(8), delgroup(8), deluser(8)


and that's the whole page, bestie, you ate that ๐Ÿ“ this lil' gem ships with Debian GNU/Linux, and the page is literally called ADDUSER.CONF(5) โ€” go forth and configure responsibly ๐Ÿ’…โœจ๐Ÿซถ

๐Ÿ“ฆ where this page comes from