Coming from the server side, I have been tasked at integrating a handful of workstations running Fedora 42 with Active Directory.
It initially worked quite nicely, as expected, until we had a user logging in, with a username that only contained digits, which made something (inside systemd?) explode.
Setup:
- A simple
realm join
and the machines were joined, no issues there. - This setup is only using a single AD domain, no cross forest trusts, etc, so SSSD has usually been configured with
use_fully_qualified_names = False
or set to true, but then withdefault_domain_suffix = <domain.tld>
in the[sss]
section, such that the users didnât have to always login as âuser@domain.tldâ.
To the best of my recolection, this has worked as expected on the servers. However Fedora 42 clearly uses a much newer mix of systemd and its friends.
When setting use_fully_qualified_names = False
, then I am able to login using a ânormalâ username (e.g. âuserâ), however i am experiencing mixed results, using a username that is entirely made up of numbers (e.g., â12345â), SSH will let me in, but fails to start dbus, and graphical logins throws me back to the login screen (presumably due to the missing dbus?).
When logging in through SSH, then i can see that systemd failed setting up the user session properly, as evident by this error:
12345@v-dev-f42:~$ systemctl --user status
Failed to connect to user scope bus via local transport: $DBUS_SESSION_BUS_ADDRESS and $XDG_RUNTIME_DIR not defined (consider using --machine=<user>@.host --user to connect to bus of other user)
And in journalctl, i can see the following errors duing login:
May 21 21:40:36 v-dev-f42 sshd-session[5869]: Accepted password for 12345 from x.x.x.x port 34200 ssh2
ay 21 21:40:36 v-dev-f42 sshd-session[5869]: pam_systemd(sshd:session): Failed to get user record: Invalid argument
May 21 21:40:36 v-dev-f42 sshd-session[5869]: pam_unix(sshd:session): session opened for user 12345(uid=427608069) by 12345(uid=0)
Setting use_fully_qualified_names = True
, then both âuser@domain.tldâ and â12345@domain.tldâ, works as expected.
However setting the default_domain_suffix = domain.tld
doesnât work (as I would have expected). It fails with the same pam_systemd
error.
From an old F3x bug i learnt about the systemd-userdbd.service
and userdbctl
cli tool (newer really interacted with this before).
I am unsure if this is what is being used, but at least it seems to fail in the same situations where the pam_systemd
fails.
Question
- Is this a bug in systemd, that it canât lookup users only consisting of numbers?
- From my test below, it seems that the
userdbctl
tools fails in quite a few situations whereid
returns a result. Is this expected or is that a bug that should be reported? - Is there a way to configure Fedora 42, such that it doesnât try to use âsystemdâ to lookup user accounts, since this fails so miserably in an interprise setting? This really doesnât seem mature for GA.
Detailed information
With use_fully_qualified_names = False
defined in sssd.conf, then I get the the following results, when trying to resolve my two example user accounts with various tools:
$ id user@domain.tld
uid=......
$ id user
uid=......
$ userdbctl user user@domain.tld
User user@domain.tld does not exist. # NOT expected
I would expect, that it should be possible to lookup the user with full domain in the username, as `id` does?
$ userdbctl user user
User name: user
Disposition: container
...
Now testing the username only containing digits
$ id 12345@domain.tld
uid=......
$ id 12345
uid=......
The `id` command flawlessly returns the expected information
$ userdbctl user 12345@domain.tld
User 12345@domain.tld does not exist. # NOT expected
...
$ userdbctl user 12345
User 12345 does not exist. # NOT expected
With use_fully_qualified_names = True
(and no default domain) defined in sssd.conf, then I get the the following results
$ id user@domain.tld
uid=......
$ id user
id: âuserâ: no such user # as expected
$ userdbctl user user@domain.tld
User name: user@domain.tld
Disposition: container
...
$ userdbctl user user
User user does not exist. # as expected
Here it is expected that it is not possible to lookup the user, without the full domain information, as this is the setting from sssd.conf.
$ id 12345@domain.tld
uid=......
$ id 12345
id: â12345â: no such user # as expected
$ userdbctl user 12345@domain.tld
User name: 12345@domain.tld
Disposition: container
...
$ userdbctl user 12345
User 12345 does not exist. # as expected
And when also enabling the default domain, then all tools that i have tested, other than systemd, will work whether or not a domain is specified:
$ id user@domain.tld
uid=......
$ id user
uid=......
$ userdbctl user user@domain.tld
User name: user@domain.tld
Disposition: container
...
$ userdbctl user user
User user does not exist. # NOT expected.
The `userdbctl` command should be able to find the user with AND without the domain.