libuser.conf(5)
π libuser.conf β the config file for libuser & friends π
okay bestie, this is the File Formats Manual page for libuser.conf, and honestly? it's giving "quiet config file that runs your whole system's user database." let's get into it π«Ά
β¨ NAME β¨
libuser.conf β configuration for libuser and libuser utilities π
π FILE FORMAT π
okay so libuser.conf is a text file. leading and trailing white space on each line? ignored, we don't care. lines starting with # are ignored too β those are the little side comments, slay.
the file defines variables grouped into sections. every section starts with a section header:
[section name]
and bestie, a single section header can appear more than once in the file. it's flexible like that. πββοΈ
the lines following a section header define variables from that section:
variable = value
the value can be empty. (yes, truly empty. it's valid. no cap.)
a variable can have more than one value β you do that by using more than one line defining that variable. but heads up: all currently defined variables accept only the first value and ignore the others, if any. so don't get cute with it π
πΈ [defaults] πΈ
create_modulesβ a list of module names to use when creating user or group entries, unless the application specifies a different list. the module names in the list can be separated using space, tab or comma. default value isfiles shadow.crypt_styleβ the algorithm to use for password encryption when creating new passwords. the current algorithm may be retained when changing a password of an existing user, depending on the application.
possible values are des, md5, blowfish, sha256, sha512, and yescrypt, all case-insensitive. unrecognized values are treated as des. default value is des.
hash_rounds_min,hash_rounds_maxβ these variables specify an inclusive range of hash rounds used whencrypt_styleissha256orsha512. a number of hash rounds is chosen from this interval randomly. a larger number of rounds makes password checking, and brute-force attempts to guess the password by reversing the hash, more CPU-intensive. the number of rounds is restricted to the interval[1000, 999999999].
if only one of the above variables is specified, the number of rounds used is specified by the other variable. if neither variable is specified, the number of rounds is chosen by libc. (libc said "i got this" π )
mailspooldirβ the directory containing user's mail spool files. default value is/var/mail.moduledirβ the directory containing libuser modules. default value uses the modules installed with libuser, corresponding to the architecture of the libuser library, e.g./usr/lib/libuseror/usr/lib64/libuser(assuming libuser was configured with--prefix=/usr).modulesβ a list of module names to use when not creating user or group entries, unless the application specifies a different list. the module names in the list can be separated using space, tab or comma. default value isfiles shadow.skeletonβ the directory containing files to copy to newly created home directories. default value is/etc/skel.
π§ [import] π§
login_defsβ a path to thelogin.defsfile from shadow. if this variable is defined, the variables from the named file are used in place of some libuser variables. variables explicitly defined inlibuser.confare not affected by contents oflogin.defs.
the following variables are imported:
ENCRYPT_METHODβdefaults/crypt_styleGID_MINβgroupdefaults/LU_GIDNUMBERMAIL_DIRβdefaults/mailspooldirMD5_CRYPT_ENABβdefaults/crypt_stylePASS_MAX_DAYSβuserdefaults/LU_SHADOWMAXPASS_MIN_DAYSβuserdefaults/LU_SHADOWMINPASS_WARN_AGEβuserdefaults/LU_SHADOWWARNINGSHA_CRYPT_MIN_ROUNDSβdefaults/hash_rounds_minSHA_CRYPT_MAX_ROUNDSβdefaults/hash_rounds_maxUID_MINβuserdefaults/LU_UIDNUMBER
the following variables are not imported: CREATE_HOME, GID_MAX, MAIL_FILE, SYSLOG_SG_ENAB, UID_MAX, UMASK, USERDEL_CMD, USERGROUPS_ENAB. they're just not invited to the party, sorry π
default_useraddβ a path to thedefault/useraddfile from useradd in shadow. if this variable is defined, the variables from the named file are used in place of some libuser variables. variables explicitly defined inlibuser.confare not affected by contents ofdefault/useradd.
the following variables are imported:
EXPIREβuserdefaults/LU_SHADOWEXPIREGROUPβuserdefaults/LU_GIDNUMBERHOMEβuserdefaults/LU_HOMEDIRECTORYINACTIVEβuserdefaults/LU_SHADOWINACTIVESHELLβuserdefaults/LU_LOGINSHELLSKELβdefaults/skeleton
the HOME variable value has /%n appended to it before importing. periodt.
π [userdefaults] π
this section defines attribute values of newly created user entities. there is one special variable:
LU_UIDNUMBERβ a decimal number, the first allowed UID value for regular users (not system users). default value is500.
all other variables have the same names as the attribute names from <libuser/entity.h> and define attribute values. either the macro name (e.g. LU_GECOS) or the macro content (e.g. pw_gecos) can be used; if both are used, the one appearing later in the configuration file is used. last one wins, that's the rule π
the % character in the value of the variable introduces an escape sequence: %n is replaced by the user name, %d is replaced by current date in days since the epoch, %u is replaced by the user's UID. there is no way to escape the % character and avoid this substitution. so if you were trying to be sneaky with a literal %, nope, it's getting substituted, no cap π
after the userdefaults section is processed, modules may define additional attributes or even override the attributes defined in this section. main character modules fr.
π [groupdefaults] π
the groupdefaults section is similar to userdefaults. there is one special variable:
LU_GIDNUMBERβ a decimal number, the first allowed GID value for regular groups (not system groups). default value is500.
the other variables follow the same rules as in the userdefaults section, except that %n and %u are replaced by the group name and group's GID, respectively.
after the groupdefaults section is processed, modules may define additional attributes or even override the attributes defined in this section.
ποΈ [files] ποΈ
configures the files module, which manages /etc/group and /etc/passwd. the configuration variables are probably useful only for libuser development. (iykyk π§)
directoryβ the directory containing the group and passwd files. default value is/etc.nonrootβ allow module initialization when not invoked as the root user if the value isyes.allow_id_duplicatesβ allow to use duplicate uid/gid. the default value isno.
π [shadow] π
configures the files module, which manages /etc/gshadow and /etc/shadow. the configuration variables are probably useful only for libuser development.
directoryβ the directory containing the gshadow and shadow files. default value is/etc.nonrootβ allow module initialization when not invoked as the root user if the value isyes.
π¦ [ldap] π¦
configures the ldap module, which manages an user database accessible using LDAP. buckle up bestie, this section is long.
userBranchβ the LDAP suffix for user entities. default value isou=People.groupBranchβ the LDAP suffix for group entities. default value isou=Group.serverβ a domain name or an URI of the LDAP server. the URI can use theldap,ldapior theldapsprotocol. when a simple domain name is used, the connection fails if TLS can not be used; an URI using theldapprotocol allows connection without TLS. TLS is never used with theldapiprotocol. default value isldap.basednβ the base DN of the server. default value isdc=example,dc=com.binddnβ a DN for binding to the server. if the value is empty or binding using this DN fails, a DN ofuid=user,userBranch,basednis used, whereuserBranchandbasednare variables from this section anduseris the user name of the invoking user, unless overridden by theuservariable from this section. default value iscn=manager,dc=example,dc=com.userβ the SASLv2 identity for authenticating to the LDAP server, also overrides the user name for generating a bind DN. default value is the name of the invoking user.passwordβ the password used for a simple bind by default. if not specified, there is no default and the user must supply the password each time.
π¨ IT IS STRONGLY RECOMMENDED NOT TO STORE A PASSWORD IN THE SYSTEM-WIDE /etc/libuser.conf FILE. the configuration file is world-readable by default, and setuid programs that prompt for a server name could be used to send the password to an attacker-controlled server. bestie. do NOT do this. i am begging ππ
authuserβ the SASLv2 authorization user, if non-empty. default value is empty.bindtypeβ the list of bind types to use, separated by commas. allowed bind types aresimple,sasl, andsasl/mechanism, wheremechanismis a SASL mechanism. the bind types (but not necessarilymechanism) are case-insensitive. if more than one bind type is specified, their relative order is ignored. default value issimple,sasl.
π [sasl] π
configures the sasl module, which manages a SASLv2 user database.
appnameβ name of the SASLv2 application. default value is empty.domainβ domain used by libuser for the SASLv2 authentication object. default value is empty.
π BUGS π
invalid lines in the configuration file (or the imported shadow configuration files) are silently ignored. no error, no warning, just vibes. it'll just sit there pretending nothing happened π
π FILES π
/etc/libuser.confβ the default location of the configuration file. can be overridden by theLIBUSER_CONFenvironment variable, except in set-uid or set-gid programs.
and that's the whole page, bestie π«Ά this was libuser, dated 2010-02-08, and you just read libuser.conf(5). go forth and configure responsibly β¨ππΈ
π¦ where this page comes from
- centos-stream 10: libuser 0.64-12.el10 Β· LGPL-2.0-or-later
- debian bookworm: libuser 1:0.64~dfsg-1 Β· LGPL-2.0-or-later
- debian trixie: libuser 1:0.64+git20241106~dfsg-3 Β· LGPL-2.0-or-later
- fedora 43: libuser 0.64-16.fc43 Β· LGPL-2.0-or-later
- fedora 43: libuser 0.64-16.fc43 Β· LGPL-2.0-or-later
- fedora 44: libuser 0.64-17.fc44 Β· LGPL-2.0-or-later
- fedora 44: libuser 0.64-17.fc44 Β· LGPL-2.0-or-later
- opensuse-leap 16.0: libuser 0.64-bp160.1.1 Β· LGPL-2.0-or-later
- opensuse-leap 16.0: libuser 0.64-bp160.1.1 Β· LGPL-2.0-or-later
- opensuse-leap 16.0: libuser 0.64-bp160.1.1 Β· LGPL-2.0-or-later
- opensuse-leap 16.0: libuser 0.64-bp160.1.1 Β· LGPL-2.0-or-later
- ubuntu noble: libuser 1:0.64~dfsg-2build2 Β· LGPL-2.0-or-later
- ubuntu questing: libuser 1:0.64+git20241106~dfsg-3
- ubuntu resolute: libuser 1:0.64+git20241106~dfsg-4build1 Β· LGPL-2.0-or-later
- ubuntu stonking: libuser 1:0.64+git20241106~dfsg-4build1 Β· LGPL-2.0-or-later
- Copyright (C) 2005, 2008, 2010 Red Hat, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms