Skip to main content
RunBook Academy

LinuxXXVII · Authentication and Enterprise IdentitySSSD AD

SSSD and Active Directory integration

Advanced⏱ ~14 minrealmsssctlkinit

What you'll learn

  • Join a Linux host to an Active Directory domain
  • Configure SSSD for AD with Kerberos
  • Verify single sign-on with ssh
  • Troubleshoot common integration issues

Prerequisites

Verified against Ubuntu 24.04 LTS · Debian 12 (Bookworm) · RHEL 9.x · Rocky Linux 9.x · AlmaLinux 9.x · Linux kernel 6.1 LTS / 6.6 LTS · systemd 255+ · OpenSSH 8.7p1 (RHEL 9) / 9.6p1 (Ubuntu 24.04) · nftables 1.0.x · chrony 4.x · Pacemaker 2.1.x · Corosync 3.1.x · 2026-08-09

Not yet marked complete on this device.

Joining a Linux host to Active Directory is the standard way to integrate Linux into a Windows-centric enterprise. This lesson walks through the configuration end-to-end.

Prerequisites

  • An Active Directory domain with at least one Domain Controller.
  • A Linux host with sssd-ad, realmd, adcli, krb5-user installed.
  • DNS configured to find the DC (dc1.example.com resolves).
  • Time synchronisation (NTP) configured.

Discover the realm

sudo realm discover example.com

Output:

example.com
  type: active-directory
  domain-name: example.com
  configured: no
  server-software: active-directory
  client-software: sssd
  required-package: sssd-tools
  ...

If the realm is not discovered, check DNS for the domain and the DC’s SRV records.

Join the domain

sudo realm join example.com --user=Administrator

Prompts for the AD admin password. The command:

  • Creates a computer object in AD.
  • Generates a Kerberos keytab for the host.
  • Configures SSSD.
  • Configures NSS and PAM.

After joining:

sudo realm list

Shows the joined domain.

Configure SSSD for AD

realm join generates /etc/sssd/sssd.conf. A typical AD config:

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

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

Configure sudo

To allow AD groups to use sudo:

sudo realm permit -g "linux-admins@example.com"    # full sudo
sudo realm permit -g "linux-users@example.com" --withtype=USER_TYPE_REGULAR

Or manually in /etc/sudoers.d/ad:

%linux-admins@example.com ALL=(ALL) ALL
%linux-users@example.com ALL=(ALL) NOPASSWD: /usr/bin/systemctl status

Configure SSH for Kerberos

# /etc/ssh/sshd_config
GSSAPIAuthentication yes
UsePAM yes
# /etc/ssh/ssh_config (client)
Host *.example.com
    GSSAPIAuthentication yes
    GSSAPIDelegateCredentials yes

Verify

getent passwd alice@EXAMPLE.COM       # user visible
kinit alice@EXAMPLE.COM              # get Kerberos TGT
klist                                # show tickets
ssh alice@server.example.com         # SSO, no password prompt

Common failure modes

SymptomCauseFix
Discovery failsDNS, networkVerify dig _ldap._tcp.example.com SRV
Join fails: clock skewNTP not configuredConfigure NTP
Join fails: wrong credentialsAD user, MFAUse a non-MFA admin account
getent returns nothingSSSD not runningsystemctl restart sssd
Login prompts for passwordSSSD misconfiguredCheck /etc/sssd/sssd.conf
Kerberos fails: clock skewNTPSame as above
SSH requires passwordGSSAPIAuthentication noEnable in sshd_config

Offline behaviour

For laptop users, SSSD caches credentials:

sudo sssctl domain-status example.com
# Online status: online

When offline:

sudo sssctl domain-status example.com
# Online status: offline
# cached credentials are used

Users can log in with cached credentials for up to offline_credentials_expiration days (default 30).

Knowledge check

Knowledge check · 3 questions

  1. Q1. Which command joins a Linux host to Active Directory?

  2. Q2. After joining AD, SSH requires a password for AD users unless GSSAPIAuthentication is enabled.

  3. Q3. Which of the following are common AD integration failures? Select all that apply.

Passing score: 75%. Answers are checked in this browser.