Join our Newsletter — 33% off our NHI Course
Home› Guides› SSSD and Linux Active Directory Integration Guide: Secure…
Guide Identity & Access Management (IAM)

SSSD and Linux Active Directory Integration Guide: Secure Joins, Access Rules and Caches

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, edited by Lalit Choda Updated 8 November 2026 13 min read
On this page

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, the simple provider, ad_access_filter or AD GPO logon rights, and test what happens with each.
  • The machine account is a non-human identity. /etc/krb5.keytab holds 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_credentials stores password hashes locally and offline_credentials_expiration defaults 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 /tmp are 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.

FunctionSSSD component or settingAD side
Joinrealmd with adcli (default) or Samba; creates the computer object and /etc/krb5.keytabComputer account in the chosen OU, with a service principal such as host/shortname
Identity lookupsid_provider = ad; NSS responder answers getent and idLDAP (389, or LDAPS 636 with ad_use_ldaps), Global Catalog 3268
UID and GIDldap_id_mapping = true (default) derives IDs from SIDs; false uses uidNumber and gidNumberPOSIX attributes on users if mapping is off
Authenticationauth_provider = ad, pam_sss in the PAM stackKerberos (88), password change (464)
Access controlaccess_provider: ad (filter and GPO), simple, permit, denyGPO logon rights read over SMB (445)
Machine passwordRenewed by SSSD when older than ad_maximum_machine_account_password_age (default 30 days)Computer account password and keys
DNSdyndns_update = true by default, refreshed every 24 hours with GSS-TSIGSecure dynamic updates
Ticket cachesKCM responder when default_ccache_name = KCM: in krb5.confUser 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

OptionChoose whenTrade-off
SSSD direct joinOne forest, Linux hosts need AD logins, sudo and SSH key lookupsLinux policy (HBAC, sudo) lives in AD groups and GPOs, which AD teams may not model well
WinbindHosts serve SMB file shares with Samba, or need NTLM featuresMore moving parts; Samba security updates become part of the host's patch scope
IdM or FreeIPA with AD trustLarge Linux estates, multiple forests, central HBAC and sudo for LinuxAnother 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-password lets a pre-created computer object be joined without any reusable credential on the build host; --computer-ou places the object where the right GPOs and delegations apply.
  • Kerberos instead of passwords: run kinit as the join account and omit --user, so no password is passed on a command line or stored in a script.
  • Leaving cleanly: realm leave --remove removes 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

MechanismHow it worksWatch out for
realm permit -g [email protected]Writes access_provider = simple with simple_allow_groupsGroups must be in the SSSD domain; local groups are ignored
simple providerAllow and deny lists for users and groups; deny overrides allowAll lists empty means everyone is allowed
ad_access_filterLDAP filter a user must match, for example a memberOf conditionNested 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 batchThe mapping surprises Windows admins; sudo is in the permit list, so GPO does not restrict sudo
sudo rulesLocal sudoers or rules served by SSSD from the directorySee 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.

CredentialWhere it livesRiskControl
Machine account keys/etc/krb5.keytab (root only)Root on the host can authenticate to AD as the computer; copied images duplicate the identityNever 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 passwordBuild scripts, CI variables, image pipelinesReusable credential that can create computer objectsOne-time passwords or a vaulted, OU-scoped account
Service keytabs for applicationsApplication directories, for example HTTP or NFS principalsLong-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 credentialsSSSD cache under /var/lib/sss/dbPassword hashes of users who have logged in, recoverable by root and crackable offlineExpiry, limited caching on shared or exposed hosts; see the Credential Dumping Guide
User ticket cachesFILE caches in /tmp/krb5cc_* or KCM database under /var/lib/sss/secretsPass 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

SignalSourceWhy it matters
pam_sss authentication success and failure/var/log/secure or auth.log, journalSpraying, unusual source hosts
Access denied by SSSD (GPO, filter or simple rules)SSSD domain logs in /var/log/sssd/, PAM messagesConfirms rules work; spikes show probing or misconfiguration
Offline authenticationSSSD logs when domain is offlineAttackers can cut DC access to force cached-credential logins
Reads of /etc/krb5.keytab or /var/lib/sss/db by unexpected processesauditd watches (-w /etc/krb5.keytab -p r), EDRCredential theft from the host (T1003, T1558.005)
Kerberos TGT requests for the computer account from another IPDomain controller event 4768Stolen keytab used elsewhere
Computer object changes and resetsDomain controller events 4741, 4742Unexpected re-join or takeover of a Linux computer account
Logon to Linux by Tier 0 accountsLinux auth logs joined with AD group dataTiering 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_expiration set.
  • Join credential exposure: number of build pipelines holding a reusable join password; target zero.

Hardening baseline

SettingRecommendedDefault and reason
Access rulesaccess_provider = ad with GPO enforcing plus ad_access_filter, or simple with allow groupsAn empty simple configuration or permit lets every domain user in
cache_credentialsTrue only where offline login is needed (laptops, edge sites)False by default; servers in a data centre rarely need it
offline_credentials_expirationA small number of days (for example 1 to 7)0 by default, meaning no limit
offline_failed_login_attempts and offline_failed_login_delayFor example 3 attempts, 5 minute delay0 attempts by default means unlimited offline guessing
account_cache_expirationA value in days so long-gone users are purged0 by default keeps entries indefinitely
ad_maximum_machine_account_password_ageKeep 30 days or align with AD policyNever set to 0, which disables renewal
use_fully_qualified_namesTrue in multi-domain environmentsAvoids name collisions between local and domain users
LDAP transportSASL GSSAPI signing (default) or ad_use_ldaps = TrueAligns with AD LDAP signing and channel binding requirements
Kerberos encryptionAES only; avoid crypto policy changes that re-enable RC4 unless a legacy DC requires itRC4 keys are easier to crack
Ticket cachesdefault_ccache_name = KCM: in /etc/krb5.confKeeps caches out of /tmp with UID-checked access
File permissionssssd.conf and snippets root:root 0600; keytab root 0600SSSD refuses insecure config permissions

Rolling out access rules safely

  1. Inventory joined hosts with realm list output and the effective access_provider on each.
  2. Define groups per server class in AD and populate them from your IGA process.
  3. Pilot in permissive mode where using GPO: ad_gpo_access_control = permissive logs what would be denied without blocking.
  4. Test interactive SSH, cron jobs for service accounts (batch logon right), sudo, console login and offline behaviour with the DC unreachable.
  5. Enforce by configuration management and keep an open root session during the change.
  6. Rollback: revert to the previous sssd.conf snippet and run sssctl cache-remove or restart SSSD if stale decisions persist.

Common misconfigurations

  • Everyone can log in: a join with no realm permit or 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 areaNIST SP 800-53 Rev. 5NIST CSF 2.0ATT&CK
Machine identity and join accountIA-3, IA-5PR.AA-01T1078.002
Login restriction per server classAC-3, AC-6PR.AA-05T1021.004
Cached credential expiryIA-5(13)PR.AA-03T1003
Ticket cache protectionSC-12, IA-5PR.AA-01T1558.005
Account lifecycle of computer objectsAC-2PR.AA-01T1078.002
Monitoring keytab and cache accessSI-4, AU-12DE.CM-09T1558.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_credentials to hosts that need offline login and set offline_credentials_expiration and 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.keytab and the SSSD cache, and collect SSSD and PAM logs centrally.
  • Remove computer objects with realm leave --remove at decommission and review stale Linux computer accounts quarterly.

Standards and references

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

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Researched and written by the NHI Mgmt Group editorial team using AI tools, under the editorial direction of Lalit Choda. Facts are drawn from the sources listed on this page and checked by our automated quality process. Last updated 8 November 2026. Spotted an error? Use our contact page.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM and Agentic AI security. nhimg.org

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick the PDF box to continue.