minsysusers(8)
π minsysusers β the manual, but make it make sense
ok so bestie, you found the minsysusers page in the GNU/Linux System Administrator's manual and honestly? it's giving minimalistic-sysusers.d-parser realness. Let's get into it. π¦
β¨ NAME β¨
minsysusers β a minimalistic sysusers.d conf files parser. That's it, that's the whole vibe. no cap.
πΈ SYNOPSIS πΈ
/usr/sbin/minsysusers [--root=/path] file.conf [ file2.conf ... ]
π DESCRIPTION π
So basically, minsysusers takes declarative conf files as input and creates system users and groups according to the sysusers.d(5) specifications. iconic behavior.
To actually create users and groups it uses useradd, groupadd and usermod under the hood β those are the real ones doing the heavy lifting, minsysusers is just the main character directing them. π
Conf files are searched in /etc/sysusers.d/ and /usr/lib/sysusers.d/. And the way that files in /etc override files with the same name in /usr? periodt. that's the law.
At least one conf file must be given on the command line, and that file must exist in at least one of the searched paths. no file, no service, sorry babe. π
π OPTIONS π
--root=/path/to/rootβ takes a path to a root as its argument, and the root must exist. Users and groups get created inside of the given root, and the config files you pass on the command line will be searched inside that root too. Also important: this option can be specified only once for eachminsysusersinvocation. one and done, bestie. π
π DIFFERENCES WITH SYSTEMD-SYSUSERS π
ok this is where it gets juicy, let's compare notes:
- conf files in
/run/sysusers.d/and/usr/local/lib/sysusers.d/are ignored. Only/etc/sysusers.d/and/usr/lib/sysusers.d/are valid paths for conf files. so if you put your stuff anywhere else, it's not getting read, fr fr. - It's not possible to have
minsysusersparse all available conf files at once. Even if you give more than one file on the command line, it processes each file and callsuseradd,groupaddandusermodbefore moving on to the next one. one at a time, no multitasking energy here. minsysuserssupports a very small subset of command line options compared tosystemd-sysusers.--rootcan be given only once, and all the other options β like--image,--replace,--dry-run,--inline,--cat-config,--tldr,--no-pager,--help,--versionβ are not supported. they said no to the extras. π
π§ SYSUSERS.D: IMPLEMENTATION DETAILS π§
the specifiers situation
Specifiers as described in sysusers.d(5) are not supported. moving on. β¨
types & processing order
Types u, g, m, r are supported. The conffile's lines are grouped by type and processed in this order: r, g, u and then m.
As a consequence, the order of lines in a conffile does not matter β except for r type (more on that below). so shuffle away, bestie.
the r lines and ranges
Ranges in r lines are passed to useradd and usermod using -K, which thus overrides the SYS_UID_ and SYS_GID_ key values in /etc/login.defs.
When multiple r lines are given, the range from the first one is used β ranges from the remaining r lines are discarded. π
When a UID is specified in the ID field and that UID is free, it takes precedence over the range given with the r line.
the u lines
For u lines the default home is / and the default shell is /sbin/nologin.
Both the home and shell field must start with /, be empty, or be set to -.
The gecos field value, if given, must be within double quotes; an empty or - gecos is valid.
When u! is used, the account is locked with usermod -L. π
the ID field rules
For the ID field, the special values 65535 and 4294967295 are reserved and thus not valid.
The ID field can be specified in various forms:
for u lines, the following entries are considered valid:
500
500:600
500:groupname
-:groupname
-:600
/path/to/file
/path/to/dir
When a path is given, if a system group for the path's GID is not found, the system group is automatically created. π
For all other ID entries where a groupname or a GID is specified, the corresponding system group must already exist β and it's ok to create it explicitly with a g line in the same conf file. iykyk.
for g lines, the following entries are considered valid:
500
/path/to/file
/path/to/dir
when a path is given, the path's GID is used to create the system group; the UID of the path is irrelevant.
for m lines it must be a groupname.
for r lines it must be either a single number or a min-max numeric range.
π FILES π
/etc/sysusers.d//usr/lib/sysusers.d//etc/login.defs
β SEE ALSO β
π AUTHOR π
Lorenzo Puliti <plorenzo@disroot.org> β the icon behind all of this. give them their flowers. π
and that's the whole page, bestie. minsysusers, version dated January 20, 2025, straight from the GNU/Linux System Administrator's manual β go forth and make those system users, you absolute legend. π
β¨
π¦ where this page comes from
- debian trixie: sysuser-helper 1.6.0 Β· GPL-3.0-or-later
- ubuntu questing: sysuser-helper 1.6.0
- ubuntu resolute: sysuser-helper 1.6.0build1 Β· GPL-3.0-or-later
- ubuntu stonking: sysuser-helper 1.6.0build1 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms