Fedora

Join Fedora 45 to Active Directory with realmd and SSSD

realm join doesn’t join anything by itself. It hands the computer account to adcli, writes /etc/sssd/sssd.conf, and switches the PAM stack with authselect, and each of those pieces fails in its own way when you join Fedora to Active Directory. That is why “the join worked but nobody can log in” is such a common report. The join is three changes, and only one of them talks to the domain controller, so a clean join message tells you very little about whether your users can actually get a session.

Original content from computingforgeeks.com - post 198872

This guide follows one machine, client01, from discovery through the join, the first AD login, group-based access, sudo from an AD group and Kerberos single sign-on, then breaks it on purpose to collect the real errors. Everything below is current for Fedora 45 as of December 2026, with realmd, SSSD and adcli from the Fedora repositories, against a Windows Server 2025 domain controller for corp.example.com.

Prerequisites and the lab layout

Your client has to reach the domain controller on the ports AD clients use. Red Hat’s AD integration guide lists these core ports for RHEL, and Fedora runs the identical stack, so the list carries over unchanged.

  • 53 TCP/UDP for DNS, the only way the client finds the DC
  • 88 and 464 for Kerberos logins and password changes
  • 389 for LDAP and 3268 for the Global Catalog
  • 445 for SMB, which SSSD uses to read Group Policy

You also need an AD account that is allowed to join computers and a Fedora 45 Workstation or Server install. A Domain Admin works, but a delegated join account is better, because the join password is typed on the client and you don’t want a Domain Admin credential passing through every new laptop. If you’re starting from scratch, the Fedora 45 installation walkthrough covers both editions. The lab used two machines on one private network.

HostAddressRole
dc01.corp.example.com10.142.0.10Windows Server 2025 DC, DNS for corp.example.com
client01.corp.example.com10.142.0.20Fedora 45, SELinux enforcing

The diagram shows the path one login takes once the join is done. Only the client and one DC are involved, and every arrow starts on the client. The numbers follow one login from the prompt through PAM and SSSD to the DC services it queries. The troubleshooting table at the end walks the same pieces in the order you should check them.

Architecture diagram: an AD user logs in to client01 through sshd or GDM and pam_sss, sssd then queries AD DNS on 53, the Kerberos KDC on 88 and 464, and LDAP and the Global Catalog on 389, 3268 and 445 on dc01

The domain controller is Windows Server 2025 Datacenter Evaluation (build 26100, Server Core), promoted as the first DC of a new corp.example.com forest with AD DNS on the same box. Every output block in this guide comes from that DC and the Fedora client, and the steps that happen on the DC are shown as the PowerShell that ran there. If you would rather practise against a Linux DC first, the Samba AD domain controller guide builds one on Debian.

Two variables carry the domain

The domain name and the DC address appear in most commands below, so export them once in the shell you’ll work from and swap in your own values.

export AD_DOMAIN="corp.example.com"
export DC_IP="10.142.0.10"

The Kerberos realm is the same name in capitals, CORP.EXAMPLE.COM, and realmd derives it for you. Commands that run under sudo still see these values, because your shell expands them before sudo starts.

One client setting has to be right before the join, and the Fedora Cloud image gets it wrong: the hostname. adcli builds the machine’s service principals from it. With the short name client01 it registered only host/CLIENT01, so Kerberos SSH to client01.corp.example.com later failed with Server not found in Kerberos database. Fixing that afterwards takes a rejoin, so set the fully qualified name now, then restart realmd, because its unit runs with ProtectHostname=yes and a realmd that was already running keeps seeing the old name.

sudo hostnamectl set-hostname client01.${AD_DOMAIN}
sudo systemctl restart realmd
hostname

The answer must be the full name, client01.corp.example.com. If you only notice after the join, the fix is the same two commands followed by a leave and a fresh join, which the errors section covers.

The client stack is not preinstalled

Fedora’s comps file puts realmd in the Workstation and Server package sets, but sssd-ad and adcli sit in the optional domain-client group, and the Cloud and minimal images ship none of them. On the lab client every piece was missing, and authselect was still on the local profile.

rpm -q realmd sssd adcli oddjob-mkhomedir samba-common-tools krb5-workstation
authselect current

Each package answered “not installed”. The profile line is the part to remember, because the join is what changes it, and a client that still shows local after a join has not really been joined.

package realmd is not installed
package sssd is not installed
package adcli is not installed
package oddjob-mkhomedir is not installed
package samba-common-tools is not installed
package krb5-workstation is not installed
Profile ID: local
Enabled features:
- with-silent-lastlog

Install the whole set in one transaction, so the join itself has nothing left to fetch and its output shows only the domain work. sssd-tools is not in this list on purpose, because you only need it for troubleshooting later.

sudo dnf install -y realmd sssd adcli oddjob oddjob-mkhomedir samba-common-tools krb5-workstation

It ran as a 51-step transaction on the lab client, pulling in sssd-ad and sssd-ipa as dependencies of the sssd metapackage. These are the versions that landed.

realmd-0.17.1-21.fc45.x86_64
sssd-2.13.2-2.fc45.x86_64
adcli-0.9.3.1-6.fc45.x86_64
samba-common-tools-4.25.1-1.fc45.x86_64
krb5-workstation-1.22.3-1.fc45.x86_64
oddjob-mkhomedir-0.34.7-20.fc45.x86_64

You can leave firewalld alone on the client for this. Every connection in the join is outbound from Fedora to the DC, so no inbound port needs opening unless you want SSH logins, which the SSH server guide for Fedora Workstation covers.

DNS decides whether realm finds the domain

What happens when you run realm discover before the client uses the DC for DNS? It doesn’t fall back to broadcast. It asks for the _ldap._tcp SRV record, then tries the domain name itself as an LDAP host, and when the upstream resolver knows neither, it quits.

realm discover ${AD_DOMAIN}

The resolver at that point was the network’s default, which knows nothing about corp.example.com, so the answer is a flat refusal. The message does not mention DNS at all, which is why people go looking for a firewall problem first.

realm: No such realm found: corp.example.com

Fedora runs systemd-resolved in stub mode, so if you edit /etc/resolv.conf by hand, the change is overwritten on the next network event. Set the DNS server on the NetworkManager connection instead. Find the active connection name first, because it varies: a Workstation install usually says “Wired connection 1”, while the lab’s Cloud image named it “cloud-init eth0”.

nmcli -t -f NAME,DEVICE connection show --active

Then point the connection at the DC, ignore the DNS servers DHCP hands out, and add the AD domain as a search suffix. Without ignore-auto-dns, the DHCP resolver stays in the list and lookups for the AD zone fail whenever it answers first. With it, the DC is your only resolver, so it has to forward external names too, which AD DNS does through a forwarder or its root hints.

sudo nmcli connection modify "cloud-init eth0" ipv4.dns ${DC_IP} ipv4.ignore-auto-dns yes ipv4.dns-search ${AD_DOMAIN}
sudo nmcli connection up "cloud-init eth0"

A resolver change is easy to get half right. Check three things before you go further, in this order, using the DEVICE name from the nmcli output in place of the lab’s eth0:

  1. the link uses the DC as its DNS server
  2. the _ldap._tcp SRV record names the DC on 389
  3. the _kerberos._tcp SRV record names it on 88
resolvectl dns eth0
dig +short -t SRV _ldap._tcp.${AD_DOMAIN}
dig +short -t SRV _kerberos._tcp.${AD_DOMAIN}

Both records name dc01 with the right ports. If either query returns nothing, stop here, because the join reads the same records and will fail exactly the way discovery did.

Link 2 (eth0): 10.142.0.10
0 100 389 dc01.corp.example.com.
0 100 88 dc01.corp.example.com.

Run realm discover -v ${AD_DOMAIN} again and it succeeds. Its required-package lines are realmd’s own list of what a join needs, which is a handy cross-check if you trimmed the install command.

corp.example.com
  type: kerberos
  realm-name: CORP.EXAMPLE.COM
  domain-name: corp.example.com
  configured: no
  server-software: active-directory
  client-software: sssd
  required-package: sssd-common
  required-package: oddjob
  required-package: oddjob-mkhomedir
  required-package: sssd-ad
  required-package: adcli
  required-package: samba-common-tools

configured: no is the line to watch. It flips to kerberos-member after the join, and it is the quickest way to tell whether a machine someone hands you is already joined.

The whole sequence fits in one terminal: the failed discovery, the resolver now pointing at the DC, both SRV answers, and the verbose discovery that finds the realm.

realm discover failing with No such realm found, then resolvectl and dig showing the Windows DC's SRV records, then realm discover -v succeeding on Fedora 45

The Performing LDAP DSE lookup line, which only -v prints, is the probe on port 389 that follows the SRV answer. If discovery stalls there, DNS is fine and something between you and the DC is dropping LDAP.

realm join hands the work to adcli

Run the join with -v. Without it you get one line of success or one line of failure, and the verbose output is the only place where the computer account, the keytab and the authselect change show up in order.

sudo realm join -v -U Administrator ${AD_DOMAIN}

It prompts for the AD account’s password, then runs adcli join against the DC it discovered. Read the output as four steps:

  1. adcli looks for CLIENT01$, finds none, and creates it in CN=Computers
  2. it sets a 120 character machine password and writes the keys to /etc/krb5.keytab
  3. realmd enables and restarts sssd
  4. it runs authselect select sssd with-mkhomedir and starts oddjobd
realm join -v output on Fedora 45 creating the CLIENT01 computer account on a Windows Server 2025 DC, skipping encryption types 16, 23, 3 and 1, and enabling sssd

The four “Encryption type not permitted” lines look like errors, and they are not. Types 16, 23, 3 and 1 are 3DES, RC4 and the two single DES types. Fedora’s DEFAULT crypto policy removes all of them from the Kerberos library, so adcli refuses to advertise them on the computer account. You want that outcome. The join then ends with a message that explains most of the confusion people hit on the first login.

Join is successful!
 * Successfully enrolled machine in realm
Please note that by default, you have to use fully-qualified names
during AD user lookup & login instead of just short names
e.g. 'username@domain' instead of just 'username'. Although
fully-qualified names are recommended, this behaviour can be changed
in sssd.conf file with the 'use_fully_qualified_names = False' option.

Take that note literally. Until you change the setting, a user who types jdoe at a login prompt is an unknown local user, and the login fails before AD is ever asked.

The join writes three things locally

Everything AD-related on the client now lives in the keytab, sssd.conf and the authselect profile. Print the sssd.conf realmd generated and keep a copy, because you’ll edit it later and a rejoin throws your edits away.

sudo cat /etc/sssd/sssd.conf

The file is short, and the bottom half of the domain section decides almost everything a user experiences. Nothing in it names a DC, because SSSD finds one through the same SRV records discovery used.

[sssd]
domains = corp.example.com
services = nss, pam

[domain/corp.example.com]
default_shell = /bin/bash
krb5_store_password_if_offline = True
cache_credentials = True
krb5_realm = CORP.EXAMPLE.COM
realmd_tags = manages-system joined-with-adcli
id_provider = ad
fallback_homedir = /home/%u@%d
ad_domain = corp.example.com
use_fully_qualified_names = True
ldap_id_mapping = True
access_provider = ad

None of these defaults is wrong, but each one has a cost. Each of those lines becomes a decision later in this guide:

  • fallback_homedir puts homes at /home/[email protected]
  • use_fully_qualified_names makes plain jdoe an unknown user
  • ldap_id_mapping derives UIDs from the SID, no POSIX attributes needed
  • access_provider = ad admits every enabled user, filtered by GPO

That fourth line matters more than it looks. The sssd-ad man page says GPO-based access control defaults to enforcing, but it only takes effect when access_provider is explicitly ad. If you ever change that line, your Group Policy logon rights stop applying to this machine, and nothing warns you. Keep it in mind for the realm permit section.

Confirm the join from the client’s side with realm list, look up an AD user, and list the keytab with its encryption types. The id lookup is the real test, since it is the first command that makes SSSD talk to the DC. The lab domain has three ordinary test users, jdoe, asmith and bwilson, so swap in accounts from your own directory wherever they appear. The linux-users and linux-admins groups in the id output already existed on the lab DC; the realm permit section shows the PowerShell that created them.

realm list
id jdoe@${AD_DOMAIN}
sudo klist -ke /etc/krb5.keytab | head -6

Look for configured: kerberos-member and login-policy: allow-realm-logins first. The UID 1420401103 is the SID-mapped ID, and with default SSSD settings it is the same on every client joined to this domain, since the mapping is computed from the SID rather than stored anywhere. That matters if you share NFS homes between machines, because matching UIDs come for free.

realm list showing kerberos-member, id jdoe@corp.example.com with AD groups, and klist -ke showing only AES keys in /etc/krb5.keytab

The keytab holds only aes128-cts-hmac-sha1-96 and aes256-cts-hmac-sha1-96 keys, the visible result of those “not permitted” lines. The DC agrees, which you can check from PowerShell on the DC:

Get-ADComputer CLIENT01 -Properties msDS-SupportedEncryptionTypes,dNSHostName,servicePrincipalName | Format-List Name,dNSHostName,msDS-SupportedEncryptionTypes,servicePrincipalName

The computer object’s msDS-SupportedEncryptionTypes reads 24, which is the AES128 bit (8) plus the AES256 bit (16), so the KDC never issues this machine an RC4 ticket either. The four SPNs include both host/ forms, the short one and the FQDN, which is what the hostname step earlier buys you.

Name                          : CLIENT01
dNSHostName                   : client01.corp.example.com
msDS-SupportedEncryptionTypes : 24
servicePrincipalName          : {RestrictedKrbHost/client01.corp.example.com, RestrictedKrbHost/CLIENT01,
                                host/client01.corp.example.com, host/CLIENT01}

If host/client01.corp.example.com is missing from that list, the client joined with a short hostname, and Kerberos logins by DNS name will fail until you rejoin.

The keytab proves the machine, kinit proves the user

A working keytab doesn’t mean your users can authenticate, because the two use different secrets. Test both halves separately:

  • adcli testjoin authenticates with the machine password in the keytab
  • kinit authenticates with a user’s own password
sudo adcli testjoin
kinit [email protected]
klist

The ticket cache is KCM:1001, because Fedora stores Kerberos tickets in sssd-kcm rather than a file under /tmp. If the account’s password is close to expiry, kinit prints AD’s warning between the password prompt and the cache line.

Successfully validated join to domain CORP.EXAMPLE.COM
Password for [email protected]:
Ticket cache: KCM:1001
Default principal: [email protected]

Valid starting       Expires              Service principal
12/01/2026 15:10:26  12/02/2026 01:10:26  krbtgt/[email protected]
	renew until 12/08/2026 15:10:26

The ticket is valid for 10 hours and renewable for 7 days, AD’s defaults. If testjoin passes but kinit fails, the problem is the user account (locked, expired, wrong password), not the join, so don’t rejoin the machine to fix it. If testjoin fails, every user fails with it, and that is when a rejoin is the right move.

The first login creates the home directory

With the default access_provider = ad, any enabled AD user can log in, as long as they use the full name. Over SSH that means two @ signs, which looks wrong and works fine. On a Fedora Cloud image, password SSH is off before AD even gets a say, because /etc/ssh/sshd_config.d/50-cloud-init.conf sets PasswordAuthentication no. The lab client refused every AD password until that drop-in was removed and sshd reloaded. cloud-init writes that file, so a Workstation or Server install without cloud-init doesn’t have it. On a Cloud image, run this on the client first:

sudo rm -f /etc/ssh/sshd_config.d/50-cloud-init.conf
sudo systemctl reload sshd
sudo sshd -T | grep -i '^passwordauthentication'

The check printed PasswordAuthentication yes on the lab client, the value sshd falls back to once the cloud-init drop-in is gone. Then log in from another machine with the full AD name:

ssh [email protected]@client01.corp.example.com 'whoami; pwd; ls -ld $HOME'

pam_oddjob_mkhomedir created the home directory on the first login, owned by the AD user and the AD primary group, with mode 0700. The trailing dot on the mode string is the SELinux context marker, and oddjobd labels the directory correctly, so you do not need a restorecon afterwards.

[email protected]
/home/[email protected]
drwx------. 1 [email protected] domain [email protected] 64 Dec  1 15:10 /home/[email protected]

SSH is the easy test, but most Workstation users log in at the GDM screen. On Fedora Workstation you have two graphical routes as well:

  • the GDM login screen’s “Not listed?” link takes the full name, [email protected]
  • Settings, System, Users, Unlock, then “Add Enterprise Login” runs the same join from the GUI

The button only appears when realmd is installed. The GUI join writes essentially the same sssd.conf as the command line, plus a simple_allow_users line for the enrolling user that has no effect while access_provider = ad, so every section below applies to a machine joined either way. It does hide the adcli output, though, so if a GUI join fails, run realm join -v from a terminal to see which step broke.

realm permit swaps the access provider

Most guides treat realm permit -g as a filter added on top of the join. It isn’t. It replaces access_provider = ad with access_provider = simple, and from that moment SSSD stops evaluating AD Group Policy logon rights on this machine. You trade GPO control for a local group list, which is fine for a lab or a small team and a real loss if your security team manages logon rights centrally.

Create the two groups on the DC first, in PowerShell with the ActiveDirectory module that comes with the AD DS role. The New-ADGroup reference lists the other scopes, but SSSD resolves global security groups like these without any extra setup.

New-ADGroup -Name linux-users -GroupScope Global -GroupCategory Security
New-ADGroup -Name linux-admins -GroupScope Global -GroupCategory Security
Add-ADGroupMember -Identity linux-users -Members jdoe, asmith
Add-ADGroupMember -Identity linux-admins -Members jdoe

The cmdlets print nothing on success, so list the members to confirm who landed where. On the lab DC, Get-ADGroupMember linux-users | Format-Table Name,SamAccountName,objectClass returned the two expected users, and Get-ADGroup linux-admins showed the scope and category.

Name   SamAccountName objectClass
----   -------------- -----------
jdoe   jdoe           user
asmith asmith         user

Name              : linux-admins
GroupScope        : Global
GroupCategory     : Security
DistinguishedName : CN=linux-admins,CN=Users,DC=corp,DC=example,DC=com

A denial is only proven if someone gets denied. Three test users cover every case:

  • jdoe sits in linux-users and linux-admins
  • asmith sits in linux-users only
  • bwilson sits in neither, so the denial is visible

Back on the Fedora client, deny everyone, then permit one group. Starting from deny --all means the allow list is the only way in, which is exactly what you want to prove.

sudo realm deny --all
sudo realm permit -g linux-users@${AD_DOMAIN}
realm list | grep -E 'login-policy|permitted'

The policy changed from allow-realm-logins to allow-permitted-logins. The empty permitted-logins line means no single user is allowed by name. deny --all cleared any earlier allow entries first, so group membership is now the only way in.

  login-policy: allow-permitted-logins
  permitted-logins:
  permitted-groups: [email protected]

Now look at what it did to sssd.conf, and what a user outside the group sees. asmith logged in normally, while bwilson got the result in the screenshot.

realm permit switching sssd to the simple access provider, then the sshd journal showing pam_sss Access denied next to Failed password for bwilson

If your logon rights already live in Group Policy, skip realm permit entirely and keep access_provider = ad. SSSD maps Windows logon rights to PAM services: sshd counts as a remote interactive logon, so “Allow log on through Remote Desktop Services” and “Deny log on through Remote Desktop Services” decide SSH, while the local logon rights cover the console and GDM. The lab tested the deny side. CLIENT01 went into a new LinuxClients OU, and a GPO linked there denied bwilson the remote logon right. In the Group Policy Management Editor that setting sits under Computer Configuration, Policies, Windows Settings, Security Settings, Local Policies, User Rights Assignment, “Deny log on through Remote Desktop Services”. SSSD reads it from the GPO’s GptTmpl.inf in SYSVOL, where it is a single line under the bwilson SID.

[Privilege Rights]
SeDenyRemoteInteractiveLogonRight = *S-1-5-21-2312642884-2523730567-2989277913-1105

With access_provider = ad back and no allow list at all, jdoe and asmith logged in over SSH, and bwilson got the same pam_sss(sshd:account): Access denied and “Failed password” pair as with realm permit. sssctl user-checks -s sshd answered Permission denied for bwilson and Success for asmith, and the GPO’s GUID appeared under /var/lib/sss/gpo_cache/corp.example.com/Policies/, so SSSD had fetched it over SMB on port 445. The same policy your Windows servers follow now decides who gets a shell here. After this test the lab client went back to realm deny --all plus realm permit -g, so the sudo and short-name sections below run under the simple provider.

A denied user sees Failed password

Why does the sshd log say “Failed password” when the password was right? Because sshd logs any rejected password login that way, even when Kerberos accepted the password and the account phase refused the user afterwards. The real cause is the line just above it, written by pam_sss in the account phase, and the line above that one proves the password itself was fine, so you have to read the journal in order rather than grep for the word “Failed”.

pam_sss(sshd:auth): authentication success; logname= uid=0 euid=0 tty=ssh ruser= rhost=fe80::5054:ff:fe12:3456%eth0 [email protected]
pam_sss(sshd:account): Access denied for user [email protected]: 6 (Permission denied)
Failed password for [email protected] from fe80::5054:ff:fe12:3456%eth0 port 45426 ssh2
fatal: Access denied for user [email protected] by PAM account configuration [preauth]

The user on the other end sees even less: Connection closed by ... port 22 right after the password prompt, with no hint that the password was accepted. So when a help desk ticket says “my AD password doesn’t work on the Linux box”, check for pam_sss(sshd:account) in the journal before anyone resets a password. A reset won’t help, and it locks the user out of every other machine until they learn the new one.

sssctl answers the same question without a login attempt. It lives in the separate sssd-tools package.

sudo dnf install -y sssd-tools
sudo sssctl user-checks bwilson@${AD_DOMAIN}

The first line of its output is the verdict from the account phase, followed by what SSSD knows about the user. It does not touch the user’s password, so you can run it against a live account without locking anything.

pam_acct_mgmt: Permission denied

PAM Environment:
 - no env -
user: [email protected]
action: acct
service: system-auth

Permission denied from pam_acct_mgmt means identity and policy were both read and the access provider said no. A user SSSD cannot find at all fails earlier, with an unknown user error instead.

Watch the service: system-auth line, because it decides whether the answer is real on a machine that still uses access_provider = ad. With GPO access control on, system-auth is in none of SSSD’s GPO service maps, so it falls to ad_gpo_default_right, which denies by default. On the lab client with the GPO linked, the bare command said Permission denied for asmith, who could log in over SSH, while -s sshd said Success. Name the service you are debugging:

sudo sssctl user-checks -s sshd asmith@${AD_DOMAIN}

Under realm permit the simple provider ignores the service name, so either form gives the same verdict there.

Sudo comes from an AD group

You don’t need SSSD’s sudo provider for this. A plain sudoers drop-in that names the AD group with a % prefix is enough, because sudo resolves the group through NSS like any local group.

echo "%linux-admins@${AD_DOMAIN} ALL=(ALL) ALL" | sudo tee /etc/sudoers.d/linux-admins
sudo chmod 0440 /etc/sudoers.d/linux-admins
sudo visudo -cf /etc/sudoers.d/linux-admins

Always run the visudo -cf check. A syntax error in a drop-in can lock you out of sudo, including the local admin you’d use to fix it, and on a machine without a root password that means booting into rescue mode. If the check reports an error, fix or delete the file before you close the shell you used to write it.

%[email protected] ALL=(ALL) ALL
/etc/sudoers.d/linux-admins: parsed OK

Logged in as jdoe, who is in linux-admins, sudo id -un returns root and sudo -l shows the rule. sudo asks for the AD password here, not a local one, because pam_sss handles that prompt too.

root
User [email protected] may run the following commands on client01:
    (ALL) ALL

From jdoe’s own prompt, the same two checks look like this, with no local account involved anywhere.

AD user jdoe running sudo id -un as root and sudo -l showing the linux-admins rule on client01

asmith can log in through linux-users but is not in linux-admins, so the same command ends, after the usual sudo lecture, with a refusal. sudo also logs the attempt to the journal, which is where an auditor would look for it.

[email protected] is not in the sudoers file.

Notice that the refusal came from sudo, after a successful login. Login access and sudo are independent, and an admin needs both entries:

  • realm permit or a GPO decides who gets a session
  • the sudoers drop-in decides who gets root

Adding a user to linux-admins alone does nothing if the login policy still keeps them out. In this lab that is why both groups exist, and why jdoe is in both.

Short names are one sssd.conf change

Typing [email protected] everywhere gets old. If your client only ever joins one domain, turn off fully qualified names and give users plain home directories. Edit the two lines with sed, then validate the file and flush the cache.

sudo sed -i -e 's/^use_fully_qualified_names = True/use_fully_qualified_names = False/' -e 's|^fallback_homedir = /home/%u@%d|fallback_homedir = /home/%u|' /etc/sssd/sssd.conf
sudo sssctl config-check
sudo sss_cache -E
sudo systemctl restart sssd
id jdoe

The config check found no issues, and id jdoe now answers without the domain. The UID did not change, because ID mapping still works from the SID and not from the name.

Issues identified by validators: 0

Messages generated during configuration merging: 0

Used configuration snippet files: 0
uid=1420401103(jdoe) gid=1420400513(domain users) groups=1420400513(domain users),1420401107(linux-admins),1420401106(linux-users)

Printing the two edited lines before the check is a cheap guard against a sed pattern that silently matched nothing. The cache flush and restart from the block above ran between the check and id, and are left out of the screenshot.

sssd.conf with use_fully_qualified_names False, sssctl config-check reporting no issues, and id jdoe resolving without the domain suffix

Old names keep resolving after the switch. Three things kept working that you might expect to break:

  • ssh [email protected] logged in to /home/jdoe
  • the sudoers rule written as %[email protected] still gave root
  • the simple_allow_groups entry kept matching, and bwilson was still refused

Files are the catch. A user who logged in before the switch gets a new, empty /home/jdoe, while their old files stay in /home/[email protected], so move the contents across, or make the switch before anyone logs in.

One warning before you rely on this. realm leave followed by a new join rewrites sssd.conf from scratch. After a realm leave and a fresh join in the lab, the file was back to use_fully_qualified_names = True and access_provider = ad, the simple_allow_groups line was gone and realm list reported login-policy: allow-realm-logins. The short names and the realm permit restriction were both lost, and every enabled AD user that no GPO blocks could log in again. Reapply both after every rejoin, or better, manage them with configuration management so a rejoin can’t quietly open the machine.

Kerberos removes the password prompt

Password logins over SSH work through pam_sss, but the point of a Kerberos join is that a user with a ticket doesn’t type a password again. SSSD’s dynamic DNS update registered client01.corp.example.com in AD DNS once sssd came online after the join (sssd-ad’s dyndns_update defaults to true), so the host principal and the DNS name line up without you creating a record. On the DC, Get-DnsServerResourceRecord -ZoneName corp.example.com -Name client01 showed an A record for 10.142.0.20 with a timestamp, which is how Windows DNS marks a dynamic record that scavenging may later age out; a static record has none.

Log in as asmith, get a ticket, and SSH to the machine’s DNS name with GSSAPI as the only allowed method. Forcing the method matters for the test, because otherwise SSH falls back to a password prompt and you can’t tell which one worked.

kinit
ssh -o PreferredAuthentications=gssapi-with-mic client01.corp.example.com "whoami; hostname"
klist | grep -A1 host/

No password prompt appeared for the SSH hop, and a host/client01.corp.example.com service ticket showed up in the cache. Fedora’s sshd already allows GSSAPI, so the server side needed no change. This capture was taken after the rejoin described in the errors section, with full names back on, so on a client that still has short names whoami prints plain asmith instead.

kinit as asmith, then ssh with gssapi-with-mic to client01.corp.example.com with no password prompt and the host service ticket in klist

Use the DNS name, not the IP. GSSAPI asks the KDC for a ticket to host/<name you typed>, and there is no principal for host/10.142.0.20, so SSH by address normally falls back to a password. If you see a password prompt where you expected none, check what you typed before you check Kerberos.

Common realm join errors and their causes

Most errors below were produced on the lab client, and the RC4 case at the end comes from the crypto policy files behind it. The message usually names the wrong layer, so the fix often isn’t where the message points.

realm: No such realm found

This is almost always DNS. realmd found neither an _ldap._tcp SRV record nor a host for the name you gave it, which usually means the client isn’t using the DC, or a forwarder that knows the zone, for DNS. Fix the NetworkManager connection as shown above, then confirm with dig -t SRV _ldap._tcp.${AD_DOMAIN} before you retry. If that query does answer and discovery still fails, check that TCP 389 to the DC gets through, because realmd probes LDAP before it reports a realm.

realm: Invalid password for Administrator: Preauthentication failed

The join account’s password was wrong. The full message was realm: Invalid password for [email protected]: Preauthentication failed, followed by a journalctl REALMD_OPERATION=... hint you can follow for detail. Kerberos rejected the password before anything else happened, so nothing was created in AD and you have nothing to clean up.

realm: Already joined to this domain

realmd refuses to join a second time. To rebuild a broken join, leave first and join again.

sudo realm leave -v ${AD_DOMAIN}
sudo realm join -v -U Administrator ${AD_DOMAIN}

A plain realm leave removes the keytab entries and the domain section of sssd.conf and stops and disables sssd, but it leaves the computer object in AD, since the realm man page ties removal to --remove. The rejoin then reuses that object, which shows up as a higher key version number.

 * Found computer account for CLIENT01$ at: CN=CLIENT01,OU=LinuxClients,DC=corp,DC=example,DC=com
 * Retrieved kvno '3' for computer account in directory: CN=CLIENT01,OU=LinuxClients,DC=corp,DC=example,DC=com
 * Successfully enrolled machine in realm

Reusing the object keeps its OU and any group memberships you gave it. In the lab, the object had been moved into OU=LinuxClients for the GPO test, and the rejoin found it there, so the deny GPO kept applying without any extra step. If you want a clean object instead, delete it on the DC first, or leave with sudo realm leave --remove -U Administrator ${AD_DOMAIN}, which asks for that account’s password and removes or disables the object, depending on the account’s rights. Run as the domain Administrator in the lab, it printed Deleted computer account at: CN=CLIENT01,CN=Computers,DC=corp,DC=example,DC=com.

kvno: Server not found in Kerberos database

This one hit the lab’s first join, made while the Cloud image still had the short hostname client01. The keytab held only short-name principals, and asking the KDC for the FQDN service failed:

kvno: Server not found in Kerberos database while getting credentials for host/[email protected]

GSSAPI SSH by DNS name fails the same way. Set the FQDN with hostnamectl, restart realmd, then leave and join again. Skipping the realmd restart is the trap. The unit’s ProtectHostname=yes means a realmd started before the change keeps the old name, so a rejoin through it registers the short names again.

sudo: sssctl: command not found

sssctl isn’t part of the sssd metapackage on Fedora. Install sssd-tools, and sudo sssctl domain-status ${AD_DOMAIN} should then report Online status: Online and name the DC it is using.

Clock skew is not the usual suspect anymore

Microsoft’s Kerberos policy allows five minutes of clock difference, and older guides blame every failure on time. In the lab, a client clock pushed 10 minutes ahead of the Windows DC still got a ticket from kinit and still logged in over SSH with a password. The ticket’s start time gave it away: the client clock read 15:24, but klist showed the ticket starting at 15:14, the DC’s time. MIT Kerberos’s kdc_timesync setting, which defaults to 1, computes the offset from the KDC’s timestamps and corrects for it inside the library. Keep chronyd running anyway, because that correction never touches the system clock, so file timestamps and log lines stay wrong.

Users with RC4-only keys cannot authenticate

Accounts whose passwords haven’t changed since the domain gained AES support may only have RC4 keys, and Fedora’s DEFAULT policy won’t use RC4. The fedora-crypto-policies project ships an AD-SUPPORT subpolicy for exactly this case, applied with sudo update-crypto-policies --set DEFAULT:AD-SUPPORT. Treat it as a stopgap and reset those passwords instead, because Windows Server is retiring RC4 too, as the NTLM and Kerberos RC4 audit guide explains.

Which layer refuses a login

A login to a joined Fedora machine passes these layers in order, and each one has its own check. When something fails, start at the top and stop at the first layer that disagrees.

OrderLayerCheckFailure looks like
1DNS SRV recordsdig -t SRV _ldap._tcp.${AD_DOMAIN}No such realm found
2Machine accountsudo adcli testjoinsssd offline, every lookup fails
3User identity (NSS)id user@${AD_DOMAIN}no such user
4Authentication (Kerberos)kinit [email protected]Preauthentication failed
5Account phase (access provider)sudo sssctl user-checks -s sshd user@${AD_DOMAIN}Failed password next to pam_sss Access denied
6Privilege (sudoers)sudo -l -U user@${AD_DOMAIN}is not in the sudoers file

Layer 5 is where most “the join worked but I can’t log in” reports end, because realm permit and GPO logon rights both live there and sshd reports both as a failed password. The same order applies to Rocky Linux, AlmaLinux and RHEL clients, which run the identical realmd and SSSD stack. If your client also serves files or SSH to the network, the firewalld zones guide for Fedora covers the inbound side that the join never touches.

Keep reading

How to Upgrade Fedora 44 to Fedora 45 (GUI, CLI and Rollback) Fedora How to Upgrade Fedora 44 to Fedora 45 (GUI, CLI and Rollback) Things to Do After Installing Fedora 45 Workstation Fedora Things to Do After Installing Fedora 45 Workstation Install NVIDIA Drivers on Fedora 45/44 (Secure Boot, Legacy GPUs) Fedora Install NVIDIA Drivers on Fedora 45/44 (Secure Boot, Legacy GPUs) Install Nix Package Manager on Fedora 45 / 44 with SELinux Fedora Install Nix Package Manager on Fedora 45 / 44 with SELinux Install PowerShell on Fedora 45 / 44: Use the RHEL 10 Repo Fedora Install PowerShell on Fedora 45 / 44: Use the RHEL 10 Repo Create and Use BtrFS on Linux: Subvolumes and Snapshots Debian Create and Use BtrFS on Linux: Subvolumes and Snapshots

Leave a Comment

Press ESC to close