Joining Linux servers to Active Directory with SSSD gives one identity for every login, and the settings you choose decide who can log in, how long offline passwords stay cached, and how the machine keytab, a domain credential on every host, is protected. Most enterprises use realmd and SSSD to join RHEL, Ubuntu and SUSE systems to AD, and the join usually happens in a provisioning script that nobody reviews again. This guide explains how SSSD, Kerberos and the machine account fit together, how to restrict who can log in with GPO, filters or simple access rules, how to treat keytabs and caches as non-human credentials, and what to log. It is for Linux and AD administrators, identity architects and detection engineers.
This is an independent guide from NHI Mgmt Group, based on SSSD project's public documentation as of November 2026. It is not sponsored or reviewed by SSSD project. Product features change, so confirm settings against SSSD project's current documentation.
Key takeaways
- Restrict logins explicitly. With no access rules, any authenticated domain user can log in; use
realm permit -g, thesimpleprovider,ad_access_filteror AD GPO logon rights, and test what happens with each. - The machine account is a non-human identity.
/etc/krb5.keytabholds the computer account keys; anyone with root on the host can use them to query AD as that computer, so protect, rotate and monitor it. - Offline caching needs limits.
cache_credentialsstores password hashes locally andoffline_credentials_expirationdefaults to no limit; set an expiry and failed-attempt lockout that match your risk. - Use the least-privilege join account. Pre-create computer objects or delegate join rights to a dedicated account scoped to one OU, and use one-time passwords where possible instead of domain admin credentials in build scripts.
- Kerberos ticket caches are credentials. FILE caches in
/tmpare targeted by ATT&CK T1558.005; KCM caches and short ticket lifetimes reduce the exposure.
How identity and access work in SSSD with Active Directory
SSSD is the client side of centralised identity: it looks up users and groups in a directory, authenticates them, decides whether they may log in, and caches the results. With the AD provider it talks to domain controllers using LDAP for identity (authenticated with the machine account through SASL GSSAPI), Kerberos for authentication, and SMB to read Group Policy for access control.
| Function | SSSD component or setting | AD side |
|---|---|---|
| Join | realmd with adcli (default) or Samba; creates the computer object and /etc/krb5.keytab | Computer account in the chosen OU, with a service principal such as host/shortname |
| Identity lookups | id_provider = ad; NSS responder answers getent and id | LDAP (389, or LDAPS 636 with ad_use_ldaps), Global Catalog 3268 |
| UID and GID | ldap_id_mapping = true (default) derives IDs from SIDs; false uses uidNumber and gidNumber | POSIX attributes on users if mapping is off |
| Authentication | auth_provider = ad, pam_sss in the PAM stack | Kerberos (88), password change (464) |
| Access control | access_provider: ad (filter and GPO), simple, permit, deny | GPO logon rights read over SMB (445) |
| Machine password | Renewed by SSSD when older than ad_maximum_machine_account_password_age (default 30 days) | Computer account password and keys |
| DNS | dyndns_update = true by default, refreshed every 24 hours with GSS-TSIG | Secure dynamic updates |
| Ticket caches | KCM responder when default_ccache_name = KCM: in krb5.conf | User TGTs and service tickets |
Red Hat documents direct integration as supported for AD forest and domain functional levels from Windows Server 2008 to 2016 (Windows Server 2019 and 2022 do not add a new level) and within a single forest by default; multi-forest estates usually need an IdM trust or Winbind instead. The ports above, AD DNS and synchronised time are prerequisites. See the Kerberos Security Guide for the protocol itself.
SSSD or Winbind, direct join or IdM trust
| Option | Choose when | Trade-off |
|---|---|---|
| SSSD direct join | One forest, Linux hosts need AD logins, sudo and SSH key lookups | Linux policy (HBAC, sudo) lives in AD groups and GPOs, which AD teams may not model well |
| Winbind | Hosts serve SMB file shares with Samba, or need NTLM features | More moving parts; Samba security updates become part of the host's patch scope |
| IdM or FreeIPA with AD trust | Large Linux estates, multiple forests, central HBAC and sudo for Linux | Another identity platform to run and protect; see the FreeIPA and Red Hat Identity Management Guide |
Admin roles and privileged access
Joining with least privilege
- Dedicated join account: delegate "create computer objects" (and reset password for re-joins) on one OU to a service account used only for joins, rather than using a Domain Admin. Record it in the non-human identity inventory with an owner.
- Pre-staged objects and one-time passwords:
realm join --one-time-passwordlets a pre-created computer object be joined without any reusable credential on the build host;--computer-ouplaces the object where the right GPOs and delegations apply. - Kerberos instead of passwords: run
kinitas the join account and omit--user, so no password is passed on a command line or stored in a script. - Leaving cleanly:
realm leave --removeremoves or disables the computer object; decommissioning without it leaves enabled computer accounts whose keytabs may still exist in backups or images.
Who can log in and who can elevate
| Mechanism | How it works | Watch out for |
|---|---|---|
realm permit -g [email protected] | Writes access_provider = simple with simple_allow_groups | Groups must be in the SSSD domain; local groups are ignored |
simple provider | Allow and deny lists for users and groups; deny overrides allow | All lists empty means everyone is allowed |
ad_access_filter | LDAP filter a user must match, for example a memberOf condition | Nested group matching needs the matching rule OID; test with nested members |
AD GPO logon rights (ad_gpo_access_control = enforcing, the default) | SSSD maps PAM services to Windows logon rights: sshd and cockpit to "Allow log on through Remote Desktop Services" (remote interactive), login and su to interactive, crond to batch | The mapping surprises Windows admins; sudo is in the permit list, so GPO does not restrict sudo |
| sudo rules | Local sudoers or rules served by SSSD from the directory | See the sudo and sudoers Security Guide |
For small estates, realm permit -g per server class is clear and easy to audit. Larger estates benefit from GPO logon rights scoped by OU, because the same AD groups and OUs that govern Windows servers then govern Linux, and AD change control applies. Do not use both without documenting which one is authoritative.
- Privileged groups: map Linux admin rights to dedicated AD groups (for example
linux-admins-prod), not to Domain Admins. Domain Admins logging on to Linux servers exposes Tier 0 tickets on Tier 1 hosts. - Break-glass: keep a local, vaulted root or admin account usable when domain controllers are unreachable and the cache has expired.
Integrations, API tokens and service accounts
The integration creates several non-human credentials that are easy to forget because no person ever types them.
| Credential | Where it lives | Risk | Control |
|---|---|---|---|
| Machine account keys | /etc/krb5.keytab (root only) | Root on the host can authenticate to AD as the computer; copied images duplicate the identity | Never bake joined keytabs into images; rely on SSSD renewal (30 days default, checked every 24 hours); alert on computer accounts whose password age exceeds twice the policy |
| Join account password | Build scripts, CI variables, image pipelines | Reusable credential that can create computer objects | One-time passwords or a vaulted, OU-scoped account |
| Service keytabs for applications | Application directories, for example HTTP or NFS principals | Long-lived keys, often world-readable by mistake, Kerberoastable if a weak password backs them (T1558.003) | Use gMSA-style managed accounts where available, AES only, strict file permissions; see the Linux Service Accounts and Keytab Management Guide |
| Cached credentials | SSSD cache under /var/lib/sss/db | Password hashes of users who have logged in, recoverable by root and crackable offline | Expiry, limited caching on shared or exposed hosts; see the Credential Dumping Guide |
| User ticket caches | FILE caches in /tmp/krb5cc_* or KCM database under /var/lib/sss/secrets | Pass the ticket from stolen caches (T1558.005) | KCM with UID checks, short lifetimes, no long renewable lifetimes for admins |
- Automation accounts in AD: configuration management or backup tools that log in as AD users get the same access rules as people. Put them in dedicated groups, deny them interactive logon where they only need batch, and prefer SSH keys or certificates controlled outside AD for automation.
- SSH public keys from AD: SSSD can serve SSH public keys stored in a directory attribute through
sss_ssh_authorizedkeys, which centralises key revocation. Protect write access to that attribute, because it becomes a login credential. See the SSH Key Management Guide.
Logging and detection
| Signal | Source | Why it matters |
|---|---|---|
| pam_sss authentication success and failure | /var/log/secure or auth.log, journal | Spraying, unusual source hosts |
| Access denied by SSSD (GPO, filter or simple rules) | SSSD domain logs in /var/log/sssd/, PAM messages | Confirms rules work; spikes show probing or misconfiguration |
| Offline authentication | SSSD logs when domain is offline | Attackers can cut DC access to force cached-credential logins |
Reads of /etc/krb5.keytab or /var/lib/sss/db by unexpected processes | auditd watches (-w /etc/krb5.keytab -p r), EDR | Credential theft from the host (T1003, T1558.005) |
| Kerberos TGT requests for the computer account from another IP | Domain controller event 4768 | Stolen keytab used elsewhere |
| Computer object changes and resets | Domain controller events 4741, 4742 | Unexpected re-join or takeover of a Linux computer account |
| Logon to Linux by Tier 0 accounts | Linux auth logs joined with AD group data | Tiering violation |
Metrics
- Explicit access rules: percentage of joined hosts with a non-default access rule; target 100.
- Machine password age: joined computer accounts with password age over 60 days; each is a broken renewal or a stale object.
- Stale computer objects: Linux computer accounts with no logon in 90 days and no matching host in the CMDB.
- Cache expiry coverage: percentage of hosts with
offline_credentials_expirationset. - Join credential exposure: number of build pipelines holding a reusable join password; target zero.
Hardening baseline
| Setting | Recommended | Default and reason |
|---|---|---|
| Access rules | access_provider = ad with GPO enforcing plus ad_access_filter, or simple with allow groups | An empty simple configuration or permit lets every domain user in |
cache_credentials | True only where offline login is needed (laptops, edge sites) | False by default; servers in a data centre rarely need it |
offline_credentials_expiration | A small number of days (for example 1 to 7) | 0 by default, meaning no limit |
offline_failed_login_attempts and offline_failed_login_delay | For example 3 attempts, 5 minute delay | 0 attempts by default means unlimited offline guessing |
account_cache_expiration | A value in days so long-gone users are purged | 0 by default keeps entries indefinitely |
ad_maximum_machine_account_password_age | Keep 30 days or align with AD policy | Never set to 0, which disables renewal |
use_fully_qualified_names | True in multi-domain environments | Avoids name collisions between local and domain users |
| LDAP transport | SASL GSSAPI signing (default) or ad_use_ldaps = True | Aligns with AD LDAP signing and channel binding requirements |
| Kerberos encryption | AES only; avoid crypto policy changes that re-enable RC4 unless a legacy DC requires it | RC4 keys are easier to crack |
| Ticket caches | default_ccache_name = KCM: in /etc/krb5.conf | Keeps caches out of /tmp with UID-checked access |
| File permissions | sssd.conf and snippets root:root 0600; keytab root 0600 | SSSD refuses insecure config permissions |
Rolling out access rules safely
- Inventory joined hosts with
realm listoutput and the effectiveaccess_provideron each. - Define groups per server class in AD and populate them from your IGA process.
- Pilot in permissive mode where using GPO:
ad_gpo_access_control = permissivelogs what would be denied without blocking. - Test interactive SSH, cron jobs for service accounts (batch logon right), sudo, console login and offline behaviour with the DC unreachable.
- Enforce by configuration management and keep an open root session during the change.
- Rollback: revert to the previous
sssd.confsnippet and runsssctl cache-removeor restart SSSD if stale decisions persist.
Common misconfigurations
- Everyone can log in: a join with no
realm permitor access rules means every authenticated domain user, including contractors and service accounts, can SSH to the server. - Domain Admin in the build script: the join password is stored in a provisioning script or image pipeline and later found in a repository.
- Cloned joined images: a template captured after joining duplicates the keytab and machine identity across many hosts; renewal on one breaks the others and any copy can impersonate the computer.
- Unlimited offline cache: cached hashes of every administrator who ever logged in remain on the host indefinitely and can be cracked after a root compromise.
- GPO mapping misunderstood: admins grant "Allow log on locally" and expect SSH access to follow, or deny it and expect sudo to be blocked; SSH maps to the remote interactive right and sudo is permitted by default.
- Stale computer objects: decommissioned VMs leave enabled computer accounts; a restored backup or old image can bring the identity back.
Framework mapping
| Control area | NIST SP 800-53 Rev. 5 | NIST CSF 2.0 | ATT&CK |
|---|---|---|---|
| Machine identity and join account | IA-3, IA-5 | PR.AA-01 | T1078.002 |
| Login restriction per server class | AC-3, AC-6 | PR.AA-05 | T1021.004 |
| Cached credential expiry | IA-5(13) | PR.AA-03 | T1003 |
| Ticket cache protection | SC-12, IA-5 | PR.AA-01 | T1558.005 |
| Account lifecycle of computer objects | AC-2 | PR.AA-01 | T1078.002 |
| Monitoring keytab and cache access | SI-4, AU-12 | DE.CM-09 | T1558.005 |
Practitioner checklist
- Use a dedicated, OU-scoped join account or one-time passwords, never Domain Admin credentials in scripts.
- Set an explicit access rule on every joined host and test it with a non-member account.
- Limit
cache_credentialsto hosts that need offline login and setoffline_credentials_expirationand offline lockout values. - Keep machine password renewal on and alert on computer accounts with old passwords or logons from unexpected IPs.
- Never capture images after a domain join; join at first boot.
- Move user ticket caches to KCM and keep Kerberos AES-only.
- Monitor reads of
/etc/krb5.keytaband the SSSD cache, and collect SSSD and PAM logs centrally. - Remove computer objects with
realm leave --removeat decommission and review stale Linux computer accounts quarterly.
Standards and references
- SSSD project: Introduction to SSSD
- SSSD project: sssd-ad(5) Active Directory provider
- SSSD project: sssd.conf(5)
- SSSD project: sssd-kcm(8) Kerberos credential cache manager
- realmd: realm command reference
- Red Hat: Connecting RHEL systems directly to AD using SSSD
- MITRE ATT&CK: Steal or Forge Kerberos Tickets: Ccache Files
- NIST: SP 800-53 Rev. 5
Related NHI Mgmt Group resources: Credential Dumping Guide · Linux PAM Guide · Linux Service Accounts and Keytab Management Guide · Kerberos Security Guide · Active Directory and Entra ID Hardening Guide