<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>LDAP Archives - Linuxcent</title>
	<atom:link href="https://linuxcent.com/tag/ldap/feed/" rel="self" type="application/rss+xml" />
	<link>https://linuxcent.com/tag/ldap/</link>
	<description>Infrastructure security, from the kernel up.</description>
	<lastBuildDate>Wed, 13 May 2026 05:35:44 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.4</generator>

<image>
	<url>https://linuxcent.com/wp-content/uploads/2026/04/favicon-512x512-1-150x150.png</url>
	<title>LDAP Archives - Linuxcent</title>
	<link>https://linuxcent.com/tag/ldap/</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">211632295</site>	<item>
		<title>How Active Directory Works: LDAP, Kerberos, and Group Policy Under the Hood</title>
		<link>https://linuxcent.com/active-directory-ldap-kerberos/</link>
					<comments>https://linuxcent.com/active-directory-ldap-kerberos/#respond</comments>
		
		<dc:creator><![CDATA[Vamshi Krishna Santhapuri]]></dc:creator>
		<pubDate>Thu, 07 May 2026 11:00:00 +0000</pubDate>
				<category><![CDATA[Identity & Authentication]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Identity Management]]></category>
		<category><![CDATA[Kerberos]]></category>
		<category><![CDATA[LDAP]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Windows]]></category>
		<guid isPermaLink="false">https://linuxcent.com/?p=1796</guid>

					<description><![CDATA[<p><span class="span-reading-time rt-reading-time" style="display: block;"><span class="rt-label rt-prefix">Reading Time: </span> <span class="rt-time"> 6</span> <span class="rt-label rt-postfix">minutes</span></span>How Active Directory works under the hood: LDAP storage, Kerberos authentication, USN replication, KCC site topology, GPO delivery — and how Linux joins it.</p>
<p>The post <a href="https://linuxcent.com/active-directory-ldap-kerberos/">How Active Directory Works: LDAP, Kerberos, and Group Policy Under the Hood</a> appeared first on <a href="https://linuxcent.com">Linuxcent</a>.</p>
]]></description>
										<content:encoded><![CDATA[<span class="span-reading-time rt-reading-time" style="display: block;"><span class="rt-label rt-prefix">Reading Time: </span> <span class="rt-time"> 6</span> <span class="rt-label rt-postfix">minutes</span></span><style>
pre{position:relative;background:#1e1e1e;color:#d4d4d4;
    padding:16px 16px 16px 20px;border-radius:6px;overflow-x:auto;
    font-family:'JetBrains Mono','Fira Code','Cascadia Code',Consolas,'Courier New',monospace;
    font-size:.88em;line-height:1.6;border-left:4px solid #555}
code{background:#f4f4f4;padding:2px 5px;border-radius:3px;font-size:.9em}
pre code{background:transparent;padding:0;color:inherit}
pre[data-lang="bash"],pre[data-lang="sh"],
pre[data-lang="shell"],pre[data-lang="zsh"]{border-left-color:#4ec9b0}
pre[data-lang="yaml"],pre[data-lang="json"],
pre[data-lang="toml"],pre[data-lang="xml"]{border-left-color:#569cd6}
pre[data-lang="python"],pre[data-lang="go"],pre[data-lang="rust"],
pre[data-lang="java"],pre[data-lang="c"],pre[data-lang="cpp"]{border-left-color:#c586c0}
pre[data-lang="text"],pre[data-lang="output"],
pre[data-lang="console"]{border-left-color:#888}
.lc-copy-btn{position:absolute;top:8px;right:8px;background:#2d2d2d;color:#ccc;
    border:1px solid #444;border-radius:4px;padding:3px 9px;font-size:.75em;
    font-family:system-ui,sans-serif;cursor:pointer;opacity:0;
    transition:opacity .15s,background .15s;line-height:1.6}
pre:hover .lc-copy-btn{opacity:1}
.lc-copy-btn:hover{background:#3a3a3a;color:#fff}
.lc-copy-btn.copied{color:#4ec9b0;border-color:#4ec9b0}
.lc-lang-badge{position:absolute;top:8px;left:20px;font-family:system-ui,sans-serif;
    font-size:.7em;color:#666;text-transform:uppercase;letter-spacing:.04em;
    line-height:1;pointer-events:none;opacity:0;transition:opacity .15s}
pre:hover .lc-lang-badge{opacity:1}
table{border-collapse:collapse;width:100%;margin:16px 0}
th,td{border:1px solid #ddd;padding:10px 14px;text-align:left}
th{background:#f0f0f0;font-weight:600}
tr:nth-child(even){background:#fafafa}
</style>
<p><script>
(function(){
  if(window.__lcCodeEnhanced)return;
  window.__lcCodeEnhanced=true;
  function enhance(){
    document.querySelectorAll('pre').forEach(function(pre){
      var code=pre.querySelector('code');
      var lang='';
      if(code){var m=(code.className||'').match(/language-(\S+)/);if(m)lang=m[1].toLowerCase();}
      if(lang)pre.setAttribute('data-lang',lang);
      if(lang){var badge=document.createElement('span');badge.className='lc-lang-badge';badge.textContent=lang;pre.insertBefore(badge,pre.firstChild);}
      var btn=document.createElement('button');
      btn.className='lc-copy-btn';btn.textContent='Copy';btn.setAttribute('aria-label','Copy code to clipboard');
      pre.appendChild(btn);
      btn.addEventListener('click',function(){
        var text=code?code.innerText:pre.innerText;
        if(navigator.clipboard&&window.isSecureContext){
          navigator.clipboard.writeText(text).then(function(){ok(btn);}).catch(function(){fb(text,btn);});
        }else{fb(text,btn);}
      });
    });
  }
  function ok(btn){btn.textContent='Copied!';btn.classList.add('copied');setTimeout(function(){btn.textContent='Copy';btn.classList.remove('copied');},2000);}
  function fb(text,btn){
    try{var ta=document.createElement('textarea');ta.value=text;ta.style.cssText='position:fixed;left:-9999px;top:-9999px;opacity:0';document.body.appendChild(ta);ta.select();document.execCommand('copy');document.body.removeChild(ta);ok(btn);}
    catch(e){btn.textContent='✗ Failed';setTimeout(function(){btn.textContent='Copy';},2000);}
  }
  if(document.readyState==='loading'){document.addEventListener('DOMContentLoaded',enhance);}else{enhance();}
})();
</script></p>
<p><em>The Identity Stack, Episode 9</em><br />
<a href="/freeipa-linux-identity-management/">EP08: FreeIPA</a> → <strong>EP09</strong> → <a href="/saml-vs-oidc-vs-oauth2/">EP10: SAML/OIDC</a> → &#8230;</p>
<hr />
<h2 id="tldr">TL;DR</h2>
<ul>
<li>Active Directory is not a product that happens to use LDAP — it <em>is</em> an LDAP directory with a Microsoft-extended schema, a built-in Kerberos KDC, and DNS tightly integrated</li>
<li>Replication uses USNs (Update Sequence Numbers) and GUIDs — the Knowledge Consistency Checker (KCC) automatically builds the replication topology</li>
<li>Sites and site links tell AD which DCs are physically close — AD prefers to authenticate users against a DC in the same site to minimize WAN latency</li>
<li>Group Policy Objects (GPOs) are stored as LDAP entries (in the <code class="" data-line="">CN=Policies</code> container) and Sysvol files — LDAP tells clients which GPOs apply; Sysvol delivers the policy files</li>
<li>Linux joins AD via <code class="" data-line="">realm join</code> (uses adcli + SSSD) or <code class="" data-line="">net ads join</code> (Samba + winbind) — both register a machine account in AD and get a Kerberos keytab</li>
<li>The difference between Linux in AD and Linux in FreeIPA: AD is optimized for Windows; FreeIPA is optimized for Linux — both interoperate</li>
</ul>
<hr />
<h2 id="the-big-picture-what-ad-actually-is">The Big Picture: What AD Actually Is</h2>
<pre><code class="" data-line="">Active Directory Domain: corp.com
┌────────────────────────────────────────────────────────────┐
│                                                            │
│  LDAP directory          Kerberos KDC                      │
│  ─────────────           ──────────                        │
│  Schema: 1000+ classes   Realm: CORP.COM                   │
│  Objects: users, groups, Issues TGTs + service tickets     │
│  computers, GPOs, OUs    Uses LDAP as the account DB       │
│                                                            │
│  DNS                     Sysvol (DFS share)                │
│  ────                    ────────────────                  │
│  SRV records for KDC     GPO templates                     │
│  and LDAP discovery      Login scripts                     │
│                          Replicated via DFSR               │
│                                                            │
│  Replication engine: USN + GUID + KCC                      │
└────────────────────────────────────────────────────────────┘
          │ replicates to          │ replicates to
          ▼                        ▼
   DC: dc02.corp.com        DC: dc03.corp.com
</code></pre>
<p>EP08 showed FreeIPA as the Linux-native answer to enterprise identity. AD is the Microsoft answer — and because most enterprises run Windows clients, understanding AD is unavoidable for Linux infrastructure engineers. This episode goes behind the LDAP and Kerberos protocols to explain what makes AD specifically work.</p>
<hr />
<h2 id="the-ad-schema-ldap-with-1000-object-classes">The AD Schema: LDAP With 1000+ Object Classes</h2>
<p>AD&#8217;s schema extends the base LDAP schema with Microsoft-specific classes and attributes. Every user object is a <code class="" data-line="">user</code> class (which extends <code class="" data-line="">organizationalPerson</code> which extends <code class="" data-line="">person</code> which extends <code class="" data-line="">top</code>) with additional attributes like:</p>
<pre><code class="" data-line="">sAMAccountName   ← the pre-Windows 2000 login name (vamshi)
userPrincipalName ← the modern UPN (vamshi@corp.com)
objectGUID       ← a globally unique 128-bit identifier (never changes, even if DN changes)
objectSid        ← Windows Security Identifier (used for ACL enforcement on Windows)
whenCreated      ← creation timestamp
pwdLastSet       ← password change timestamp
userAccountControl ← bitmask: disabled, locked, password never expires, etc.
memberOf         ← back-link: groups this user belongs to
</code></pre>
<p><code class="" data-line="">objectGUID</code> is the authoritative identifier in AD — not the DN. When a user is renamed or moved to a different OU, the GUID stays the same. Applications that store a user&#8217;s DN will break on rename; applications that store the GUID won&#8217;t.</p>
<p><code class="" data-line="">userAccountControl</code> is the bitmask that controls account state:</p>
<pre><code class="" data-line="">Flag          Value   Meaning
ACCOUNTDISABLE  2     Account disabled
LOCKOUT         16    Account locked out
PASSWD_NOTREQD  32    Password not required
NORMAL_ACCOUNT  512   Normal user account (set on almost all accounts)
DONT_EXPIRE_PASSWD 65536  Password never expires
</code></pre>
<pre><code class="" data-line=""># Query AD from a Linux machine
ldapsearch -x -H ldap://dc.corp.com \
  -D &quot;vamshi@corp.com&quot; -w password \
  -b &quot;dc=corp,dc=com&quot; \
  &quot;(sAMAccountName=vamshi)&quot; \
  sAMAccountName userPrincipalName objectGUID memberOf userAccountControl
</code></pre>
<hr />
<h2 id="replication-usn-guid-kcc">Replication: USN + GUID + KCC</h2>
<p>AD replication is multi-master — every DC accepts writes. The replication engine uses:</p>
<p><strong>USN (Update Sequence Number)</strong> — a per-DC counter that increments on every local write. Each attribute in the directory stores the USN at which it was last modified (<code class="" data-line="">uSNChanged</code>, <code class="" data-line="">uSNCreated</code>). When DC-A replicates to DC-B, DC-B asks: &#8220;give me everything you&#8217;ve changed since the last USN I saw from you.&#8221;</p>
<p><strong>GUID</strong> — each object has a globally unique identifier. If the same attribute is modified on two DCs before replication (a conflict), the conflict is resolved: last-writer-wins at the attribute level, based on the modification timestamp. If timestamps are equal, the attribute value from the DC with the lexicographically higher GUID wins.</p>
<p><strong>KCC (Knowledge Consistency Checker)</strong> — a component that runs on every DC and automatically constructs the replication topology. You don&#8217;t configure which DCs replicate to which — the KCC builds a minimum spanning tree that ensures every DC is connected to every other within a set number of hops. You configure Sites and site links; the KCC does the rest.</p>
<pre><code class="" data-line=""># Check replication status from a Linux machine (requires rpcclient or adcli)
# Or on the DC: repadmin /showrepl (Windows tool)

# Simulate: query the highestCommittedUSN from a DC
ldapsearch -x -H ldap://dc.corp.com \
  -D &quot;vamshi@corp.com&quot; -w password \
  -b &quot;&quot; -s base highestCommittedUSN
</code></pre>
<hr />
<h2 id="sites-and-site-links">Sites and Site Links</h2>
<p>Sites are AD&#8217;s concept of physical network topology. A site is a set of IP subnets with high-bandwidth connectivity between them. Site links represent the WAN connections between sites.</p>
<pre><code class="" data-line="">Site: Mumbai              Site: Hyderabad
┌────────────────┐        ┌────────────────┐
│ DC: dc-mum-01  │        │ DC: dc-hyd-01  │
│ DC: dc-mum-02  │        │ DC: dc-hyd-02  │
│ subnet: 10.1/16│        │ subnet: 10.2/16│
└───────┬────────┘        └────────┬───────┘
        │                          │
        └──── Site Link ───────────┘
              Cost: 100
              Replication interval: 15 min
</code></pre>
<p>When a user in Mumbai authenticates, AD&#8217;s KDC locates a DC in the same site using DNS SRV records. The SRV records include the site name in the service name: <code class="" data-line="">_ldap._tcp.Mumbai._sites.dc._msdcs.corp.com</code>. SSSD and Windows clients query site-local SRV records first.</p>
<p>If no DC is available in the local site, authentication falls back to a DC in another site across the WAN link. Configuring sites correctly prevents remote authentication failures from killing local operations.</p>
<hr />
<h2 id="group-policy-ldap-sysvol">Group Policy: LDAP + Sysvol</h2>
<p>GPOs are stored in two places:</p>
<p><strong>LDAP</strong> — the <code class="" data-line="">CN=Policies,CN=System,DC=corp,DC=com</code> container holds GPO metadata objects. Each GPO has a GUID, a display name, and version numbers. The <code class="" data-line="">gPLink</code> attribute on OUs and the domain root links GPOs to where they apply.</p>
<p><strong>Sysvol</strong> — the actual policy templates and scripts live in <code class="" data-line="">\\corp.com\SYSVOL\corp.com\Policies\{GPO-GUID}\</code>. Sysvol is a DFS-R (Distributed File System Replication) share replicated to every DC.</p>
<p>When a Windows client applies Group Policy:<br />
1. LDAP query: what GPOs are linked to my OU chain?<br />
2. Sysvol fetch: download the policy templates from the GPO&#8217;s Sysvol path<br />
3. Apply: process Registry settings, Security settings, Scripts</p>
<p>Linux clients don&#8217;t process GPOs natively. The <code class="" data-line="">adcli</code> and <code class="" data-line="">sssd</code> tools interpret a small subset of AD policy (password policy, account lockout) via LDAP. Full GPO processing on Linux requires Samba&#8217;s <code class="" data-line="">samba-gpupdate</code> or third-party tools.</p>
<hr />
<h2 id="joining-linux-to-ad">Joining Linux to AD</h2>
<h3 id="realm-join-recommended">realm join (recommended)</h3>
<pre><code class="" data-line=""># Install required packages
dnf install -y realmd sssd adcli samba-common

# Discover the domain
realm discover corp.com
# corp.com
#   type: kerberos
#   realm-name: CORP.COM
#   domain-name: corp.com
#   configured: no
#   server-software: active-directory
#   client-software: sssd

# Join
realm join corp.com -U Administrator
# Prompts for Administrator password
# Creates machine account in AD
# Configures sssd.conf, krb5.conf, nsswitch.conf, pam.d automatically

# Verify
realm list
id vamshi@corp.com
</code></pre>
<h3 id="what-the-join-does">What the join does:</h3>
<ol>
<li>Creates a machine account <code class="" data-line="">HOSTNAME$</code> in <code class="" data-line="">CN=Computers,DC=corp,DC=com</code></li>
<li>Sets a machine password (rotated automatically by SSSD)</li>
<li>Retrieves a Kerberos keytab to <code class="" data-line="">/etc/krb5.keytab</code></li>
<li>Configures SSSD with <code class="" data-line="">id_provider = ad</code>, <code class="" data-line="">auth_provider = ad</code></li>
<li>Updates <code class="" data-line="">/etc/nsswitch.conf</code> to include <code class="" data-line="">sss</code></li>
<li>Updates <code class="" data-line="">/etc/pam.d/</code> to include <code class="" data-line="">pam_sss</code></li>
</ol>
<p>After joining, SSSD uses the machine&#8217;s Kerberos keytab to authenticate to the DC and query LDAP — no hardcoded service account credentials required.</p>
<hr />
<h2 id="ldap-queries-against-ad-from-linux">LDAP Queries Against AD from Linux</h2>
<pre><code class="" data-line=""># Find a user (after kinit or with -w password)
ldapsearch -Y GSSAPI -H ldap://dc.corp.com \
  -b &quot;dc=corp,dc=com&quot; \
  &quot;(sAMAccountName=vamshi)&quot; \
  sAMAccountName mail memberOf

# Find all members of a group
ldapsearch -Y GSSAPI -H ldap://dc.corp.com \
  -b &quot;dc=corp,dc=com&quot; \
  &quot;(cn=engineers)&quot; \
  member

# Find all AD-joined Linux machines
ldapsearch -Y GSSAPI -H ldap://dc.corp.com \
  -b &quot;dc=corp,dc=com&quot; \
  &quot;(&amp;(objectClass=computer)(operatingSystem=*Linux*))&quot; \
  cn operatingSystem lastLogonTimestamp

# Find disabled accounts
ldapsearch -Y GSSAPI -H ldap://dc.corp.com \
  -b &quot;dc=corp,dc=com&quot; \
  &quot;(userAccountControl:1.2.840.113556.1.4.803:=2)&quot; \
  sAMAccountName
</code></pre>
<p>The last filter uses an LDAP extensible match (<code class="" data-line="">1.2.840.113556.1.4.803</code> is the OID for bitwise AND). <code class="" data-line="">userAccountControl:1.2.840.113556.1.4.803:=2</code> means &#8220;entries where userAccountControl AND 2 equals 2&#8221; — i.e., the ACCOUNTDISABLE bit is set. This is a Microsoft AD extension not in standard LDAP.</p>
<hr />
<h2 id="common-misconceptions"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/26a0.png" alt="⚠" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Common Misconceptions</h2>
<p><strong>&#8220;AD is just Microsoft&#8217;s LDAP.&#8221;</strong> AD is LDAP + Kerberos + DNS + DFS-R + GPO, all tightly integrated and with a schema that the Microsoft ecosystem depends on. You can query AD with standard <code class="" data-line="">ldapsearch</code>. You cannot replace it with OpenLDAP without breaking every Windows client.</p>
<p><strong>&#8220;Linux machines in AD get GPO.&#8221;</strong> Linux machines appear in AD and can be organized into OUs. Standard GPOs don&#8217;t apply to them. Samba&#8217;s <code class="" data-line="">samba-gpupdate</code> can process a subset of AD policy for Linux — mostly Registry and Security settings mapped to Linux equivalents.</p>
<p><strong>&#8220;realm leave removes the machine cleanly.&#8221;</strong> <code class="" data-line="">realm leave</code> removes local configuration but does not delete the machine account from AD. The stale computer object stays in <code class="" data-line="">CN=Computers</code> until an AD admin deletes it. Always run <code class="" data-line="">realm leave &amp;&amp; adcli delete-computer -U Administrator</code> for a clean removal.</p>
<hr />
<h2 id="framework-alignment">Framework Alignment</h2>
<table>
<thead>
<tr>
<th>Domain</th>
<th>Relevance</th>
</tr>
</thead>
<tbody>
<tr>
<td>CISSP Domain 5: Identity and Access Management</td>
<td>AD is the dominant enterprise identity store — understanding its LDAP structure, Kerberos realm, and GPO model is essential for IAM in mixed environments</td>
</tr>
<tr>
<td>CISSP Domain 4: Communications and Network Security</td>
<td>AD replication traffic (RPC, LDAP, Kerberos) is a significant portion of enterprise WAN traffic — Sites and site links are a network security and performance design decision</td>
</tr>
<tr>
<td>CISSP Domain 3: Security Architecture and Engineering</td>
<td>AD forest/domain/OU hierarchy is an architectural decision with long-term security consequences — getting OU structure wrong constrains GPO delegation for years</td>
</tr>
</tbody>
</table>
<hr />
<h2 id="key-takeaways">Key Takeaways</h2>
<ul>
<li>AD is LDAP + Kerberos + DNS + GPO + DFS-R — not a product that &#8220;uses&#8221; these; they&#8217;re the implementation</li>
<li>Replication is multi-master via USN + GUID; the KCC builds the topology automatically from Sites configuration</li>
<li><code class="" data-line="">objectGUID</code> is the stable identifier — not the DN, which changes on rename/move</li>
<li><code class="" data-line="">realm join</code> is the correct way to join Linux to AD — it configures SSSD, Kerberos, PAM, and NSS correctly in one command</li>
<li><code class="" data-line="">userAccountControl</code> is the bitmask that controls account state — <code class="" data-line="">(userAccountControl:1.2.840.113556.1.4.803:=2)</code> finds disabled accounts</li>
</ul>
<hr />
<h2 id="whats-next">What&#8217;s Next</h2>
<p>EP09 covered AD — LDAP and Kerberos inside the corporate network. EP10 covers what happens when identity needs to work across the internet, where Kerberos doesn&#8217;t reach: SAML, OAuth2, and OIDC — the protocols that let identity leave the building.</p>
<p><em>Next: <a href="/saml-vs-oidc-vs-oauth2/">SAML vs OIDC vs OAuth2: Which Protocol Handles Which Identity Problem</a></em></p>
<p>Get EP10 in your inbox when it publishes → <a href="https://linuxcent.com/subscribe">linuxcent.com/subscribe</a></p>
<p><a class="a2a_button_mastodon" href="https://www.addtoany.com/add_to/mastodon?linkurl=https%3A%2F%2Flinuxcent.com%2Factive-directory-ldap-kerberos%2F&amp;linkname=How%20Active%20Directory%20Works%3A%20LDAP%2C%20Kerberos%2C%20and%20Group%20Policy%20Under%20the%20Hood" title="Mastodon" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_email" href="https://www.addtoany.com/add_to/email?linkurl=https%3A%2F%2Flinuxcent.com%2Factive-directory-ldap-kerberos%2F&amp;linkname=How%20Active%20Directory%20Works%3A%20LDAP%2C%20Kerberos%2C%20and%20Group%20Policy%20Under%20the%20Hood" title="Email" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_whatsapp" href="https://www.addtoany.com/add_to/whatsapp?linkurl=https%3A%2F%2Flinuxcent.com%2Factive-directory-ldap-kerberos%2F&amp;linkname=How%20Active%20Directory%20Works%3A%20LDAP%2C%20Kerberos%2C%20and%20Group%20Policy%20Under%20the%20Hood" title="WhatsApp" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Flinuxcent.com%2Factive-directory-ldap-kerberos%2F&amp;linkname=How%20Active%20Directory%20Works%3A%20LDAP%2C%20Kerberos%2C%20and%20Group%20Policy%20Under%20the%20Hood" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_x" href="https://www.addtoany.com/add_to/x?linkurl=https%3A%2F%2Flinuxcent.com%2Factive-directory-ldap-kerberos%2F&amp;linkname=How%20Active%20Directory%20Works%3A%20LDAP%2C%20Kerberos%2C%20and%20Group%20Policy%20Under%20the%20Hood" title="X" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Flinuxcent.com%2Factive-directory-ldap-kerberos%2F&amp;linkname=How%20Active%20Directory%20Works%3A%20LDAP%2C%20Kerberos%2C%20and%20Group%20Policy%20Under%20the%20Hood" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_copy_link" href="https://www.addtoany.com/add_to/copy_link?linkurl=https%3A%2F%2Flinuxcent.com%2Factive-directory-ldap-kerberos%2F&amp;linkname=How%20Active%20Directory%20Works%3A%20LDAP%2C%20Kerberos%2C%20and%20Group%20Policy%20Under%20the%20Hood" title="Copy Link" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Flinuxcent.com%2Factive-directory-ldap-kerberos%2F&#038;title=How%20Active%20Directory%20Works%3A%20LDAP%2C%20Kerberos%2C%20and%20Group%20Policy%20Under%20the%20Hood" data-a2a-url="https://linuxcent.com/active-directory-ldap-kerberos/" data-a2a-title="How Active Directory Works: LDAP, Kerberos, and Group Policy Under the Hood"></a></p><p>The post <a href="https://linuxcent.com/active-directory-ldap-kerberos/">How Active Directory Works: LDAP, Kerberos, and Group Policy Under the Hood</a> appeared first on <a href="https://linuxcent.com">Linuxcent</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://linuxcent.com/active-directory-ldap-kerberos/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1796</post-id>	</item>
		<item>
		<title>FreeIPA: LDAP + Kerberos + PKI in a Single Linux Identity Stack</title>
		<link>https://linuxcent.com/freeipa-linux-identity-management/</link>
					<comments>https://linuxcent.com/freeipa-linux-identity-management/#respond</comments>
		
		<dc:creator><![CDATA[Vamshi Krishna Santhapuri]]></dc:creator>
		<pubDate>Thu, 07 May 2026 05:00:00 +0000</pubDate>
				<category><![CDATA[Identity & Authentication]]></category>
		<category><![CDATA[FreeIPA]]></category>
		<category><![CDATA[HBAC]]></category>
		<category><![CDATA[Identity Management]]></category>
		<category><![CDATA[Kerberos]]></category>
		<category><![CDATA[LDAP]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux-security]]></category>
		<guid isPermaLink="false">https://linuxcent.com/?p=1793</guid>

					<description><![CDATA[<p><span class="span-reading-time rt-reading-time" style="display: block;"><span class="rt-label rt-prefix">Reading Time: </span> <span class="rt-time"> 5</span> <span class="rt-label rt-postfix">minutes</span></span>FreeIPA combines 389-DS, MIT Kerberos, Dogtag PKI, and Bind DNS into one Linux identity stack. Set up HBAC rules, centralized sudo, and AD trust.</p>
<p>The post <a href="https://linuxcent.com/freeipa-linux-identity-management/">FreeIPA: LDAP + Kerberos + PKI in a Single Linux Identity Stack</a> appeared first on <a href="https://linuxcent.com">Linuxcent</a>.</p>
]]></description>
										<content:encoded><![CDATA[<span class="span-reading-time rt-reading-time" style="display: block;"><span class="rt-label rt-prefix">Reading Time: </span> <span class="rt-time"> 5</span> <span class="rt-label rt-postfix">minutes</span></span><style>
pre{position:relative;background:#1e1e1e;color:#d4d4d4;
    padding:16px 16px 16px 20px;border-radius:6px;overflow-x:auto;
    font-family:'JetBrains Mono','Fira Code','Cascadia Code',Consolas,'Courier New',monospace;
    font-size:.88em;line-height:1.6;border-left:4px solid #555}
code{background:#f4f4f4;padding:2px 5px;border-radius:3px;font-size:.9em}
pre code{background:transparent;padding:0;color:inherit}
pre[data-lang="bash"],pre[data-lang="sh"],
pre[data-lang="shell"],pre[data-lang="zsh"]{border-left-color:#4ec9b0}
pre[data-lang="yaml"],pre[data-lang="json"],
pre[data-lang="toml"],pre[data-lang="xml"]{border-left-color:#569cd6}
pre[data-lang="python"],pre[data-lang="go"],pre[data-lang="rust"],
pre[data-lang="java"],pre[data-lang="c"],pre[data-lang="cpp"]{border-left-color:#c586c0}
pre[data-lang="text"],pre[data-lang="output"],
pre[data-lang="console"]{border-left-color:#888}
.lc-copy-btn{position:absolute;top:8px;right:8px;background:#2d2d2d;color:#ccc;
    border:1px solid #444;border-radius:4px;padding:3px 9px;font-size:.75em;
    font-family:system-ui,sans-serif;cursor:pointer;opacity:0;
    transition:opacity .15s,background .15s;line-height:1.6}
pre:hover .lc-copy-btn{opacity:1}
.lc-copy-btn:hover{background:#3a3a3a;color:#fff}
.lc-copy-btn.copied{color:#4ec9b0;border-color:#4ec9b0}
.lc-lang-badge{position:absolute;top:8px;left:20px;font-family:system-ui,sans-serif;
    font-size:.7em;color:#666;text-transform:uppercase;letter-spacing:.04em;
    line-height:1;pointer-events:none;opacity:0;transition:opacity .15s}
pre:hover .lc-lang-badge{opacity:1}
table{border-collapse:collapse;width:100%;margin:16px 0}
th,td{border:1px solid #ddd;padding:10px 14px;text-align:left}
th{background:#f0f0f0;font-weight:600}
tr:nth-child(even){background:#fafafa}
</style>
<p><script>
(function(){
  if(window.__lcCodeEnhanced)return;
  window.__lcCodeEnhanced=true;
  function enhance(){
    document.querySelectorAll('pre').forEach(function(pre){
      var code=pre.querySelector('code');
      var lang='';
      if(code){var m=(code.className||'').match(/language-(\S+)/);if(m)lang=m[1].toLowerCase();}
      if(lang)pre.setAttribute('data-lang',lang);
      if(lang){var badge=document.createElement('span');badge.className='lc-lang-badge';badge.textContent=lang;pre.insertBefore(badge,pre.firstChild);}
      var btn=document.createElement('button');
      btn.className='lc-copy-btn';btn.textContent='Copy';btn.setAttribute('aria-label','Copy code to clipboard');
      pre.appendChild(btn);
      btn.addEventListener('click',function(){
        var text=code?code.innerText:pre.innerText;
        if(navigator.clipboard&&window.isSecureContext){
          navigator.clipboard.writeText(text).then(function(){ok(btn);}).catch(function(){fb(text,btn);});
        }else{fb(text,btn);}
      });
    });
  }
  function ok(btn){btn.textContent='Copied!';btn.classList.add('copied');setTimeout(function(){btn.textContent='Copy';btn.classList.remove('copied');},2000);}
  function fb(text,btn){
    try{var ta=document.createElement('textarea');ta.value=text;ta.style.cssText='position:fixed;left:-9999px;top:-9999px;opacity:0';document.body.appendChild(ta);ta.select();document.execCommand('copy');document.body.removeChild(ta);ok(btn);}
    catch(e){btn.textContent='✗ Failed';setTimeout(function(){btn.textContent='Copy';},2000);}
  }
  if(document.readyState==='loading'){document.addEventListener('DOMContentLoaded',enhance);}else{enhance();}
})();
</script></p>
<p><em>The Identity Stack, Episode 8</em><br />
<a href="/ldap-high-availability/">EP07: LDAP HA</a> → <strong>EP08</strong> → <a href="/active-directory-ldap-kerberos/">EP09: Active Directory</a> → &#8230;</p>
<hr />
<h2 id="tldr">TL;DR</h2>
<ul>
<li>FreeIPA is 389-DS (LDAP) + MIT Kerberos + Dogtag PKI + Bind DNS + SSSD — one <code class="" data-line="">ipa-server-install</code> command gets you an enterprise identity platform</li>
<li>Host-Based Access Control (HBAC) lets you define centrally: which users can SSH to which hosts — no more managing <code class="" data-line="">/etc/security/access.conf</code> per machine</li>
<li>Sudo rules from the directory: define <code class="" data-line="">sudo</code> policy centrally, have every machine pull it — no <code class="" data-line="">/etc/sudoers.d/</code> files scattered across the fleet</li>
<li><code class="" data-line="">ipa</code> CLI is the management interface — <code class="" data-line="">ipa user-add</code>, <code class="" data-line="">ipa group-add</code>, <code class="" data-line="">ipa hbacrule-add</code> — everything that took five LDAP commands takes one <code class="" data-line="">ipa</code> command</li>
<li>FreeIPA trusts with Active Directory let Linux machines authenticate AD users without joining the AD domain</li>
<li>The right choice for Linux-centric environments; AD is the right choice when Windows clients dominate</li>
</ul>
<hr />
<h2 id="the-big-picture-what-freeipa-integrates">The Big Picture: What FreeIPA Integrates</h2>
<pre><code class="" data-line="">┌─────────────────────────────────────────────────────────┐
│                    FreeIPA Server                        │
│                                                         │
│  389-DS (LDAP)    MIT Kerberos    Dogtag PKI            │
│  ─────────────    ───────────     ─────────             │
│  User/group       TGT + service   Machine certs         │
│  storage          ticket issuing  User certs             │
│                                   OCSP / CRL            │
│  Bind DNS         SSSD (client)   Apache (WebUI)        │
│  ──────────       ────────────    ──────────────        │
│  SRV records      Enrollment      Management UI         │
│  for KDC/LDAP     automation      REST API              │
└─────────────────────────────────────────────────────────┘
              ▲                  ▲
              │ enrollment       │ SSH + sudo rules
   ┌──────────┴──────────┐  ┌───┴──────────────────┐
   │  Linux client        │  │  Linux client         │
   │  (ipa-client-install)│  │  (ipa-client-install) │
   └─────────────────────┘  └──────────────────────┘
</code></pre>
<p>EP06 and EP07 built OpenLDAP from components. FreeIPA gives you all of that plus Kerberos, PKI, DNS, and HBAC — opinionated, integrated, and managed through a single CLI and WebUI. This episode shows what you actually get from it.</p>
<hr />
<h2 id="why-freeipa-instead-of-bare-openldap">Why FreeIPA Instead of Bare OpenLDAP</h2>
<p>Running bare OpenLDAP requires you to:<br />
&#8211; Configure schema for POSIX accounts, SSH keys, sudo rules, HBAC manually<br />
&#8211; Set up MIT Kerberos separately and integrate it with LDAP<br />
&#8211; Build your own PKI for machine certificates<br />
&#8211; Maintain DNS SRV records for Kerberos discovery<br />
&#8211; Write client enrollment scripts<br />
&#8211; Build a management interface (or live in LDIF)</p>
<p>FreeIPA does all of this in one installer, with a consistent data model across all components. The trade-off is opacity — FreeIPA makes decisions for you (schema, replication topology, Kerberos realm name) that bare OpenLDAP leaves to you.</p>
<hr />
<h2 id="installing-freeipa-server">Installing FreeIPA Server</h2>
<pre><code class="" data-line=""># RHEL / Rocky / AlmaLinux
dnf install -y freeipa-server freeipa-server-dns

# Run the installer (interactive)
ipa-server-install

# Or non-interactive:
ipa-server-install \
  --realm=CORP.COM \
  --domain=corp.com \
  --ds-password=DM_password \
  --admin-password=Admin_password \
  --setup-dns \
  --forwarder=8.8.8.8 \
  --unattended

# After install: get an admin Kerberos ticket
kinit admin
</code></pre>
<p>The installer creates:<br />
&#8211; 389-DS instance with the FreeIPA schema<br />
&#8211; MIT KDC with realm <code class="" data-line="">CORP.COM</code><br />
&#8211; Dogtag CA and all certificate infrastructure<br />
&#8211; Bind DNS with SRV records for the KDC and LDAP server<br />
&#8211; Apache WebUI at <code class="" data-line="">https://ipa.corp.com/ipa/ui/</code><br />
&#8211; SSSD configured on the server itself</p>
<p>Time: 5–10 minutes. What used to take a week of manual configuration.</p>
<hr />
<h2 id="the-ipa-cli">The ipa CLI</h2>
<p>Every management action goes through <code class="" data-line="">ipa</code>. It talks to the IPA server&#8217;s REST API and handles Kerberos authentication transparently (it uses your <code class="" data-line="">kinit</code> session).</p>
<pre><code class="" data-line=""># Users
ipa user-add vamshi \
  --first=Vamshi --last=Krishna \
  --email=vamshi@corp.com \
  --password

ipa user-show vamshi
ipa user-find --all              # search all users
ipa user-disable vamshi          # lock account without deleting
ipa user-mod vamshi --shell=/bin/zsh

# Groups
ipa group-add engineers --desc &quot;Engineering team&quot;
ipa group-add-member engineers --users=vamshi,alice

# Password policy
ipa pwpolicy-mod --minlength=12 --maxlife=90 --history=10

# SSH public keys — stored centrally, pushed to every host
ipa user-mod vamshi --sshpubkey=&quot;ssh-ed25519 AAAA...&quot;
# SSSD on enrolled hosts will use this key for SSH login — no authorized_keys file needed
</code></pre>
<hr />
<h2 id="host-based-access-control-hbac">Host-Based Access Control (HBAC)</h2>
<p>HBAC is the feature that justifies FreeIPA for most Linux shops. It lets you define centrally: which users (or groups) can log in to which hosts (or host groups), using which services (SSH, sudo, FTP).</p>
<p>Without HBAC, access control is per-machine: <code class="" data-line="">/etc/security/access.conf</code> or PAM <code class="" data-line="">pam_access</code> rules, replicated across every server, managed inconsistently.</p>
<p>With HBAC: one rule, enforced everywhere.</p>
<pre><code class="" data-line=""># Create host groups
ipa hostgroup-add production-servers --desc &quot;Production Linux hosts&quot;
ipa hostgroup-add-member production-servers --hosts=web01.corp.com,db01.corp.com

# Create user groups
ipa group-add sre-team
ipa group-add-member sre-team --users=vamshi,alice

# Create an HBAC rule
ipa hbacrule-add allow-sre-to-prod \
  --desc &quot;SRE team can SSH to production&quot;
ipa hbacrule-add-user allow-sre-to-prod --groups=sre-team
ipa hbacrule-add-host allow-sre-to-prod --hostgroups=production-servers
ipa hbacrule-add-service allow-sre-to-prod --hbacsvcs=sshd

# Test the rule before applying
ipa hbactest \
  --user=vamshi \
  --host=web01.corp.com \
  --service=sshd
# Access granted: True
# Matched rules: allow-sre-to-prod
</code></pre>
<p>SSSD on each enrolled host enforces the HBAC rules at login time by querying the IPA server. No per-machine configuration. Add a new server to the <code class="" data-line="">production-servers</code> host group and the HBAC rules apply immediately.</p>
<hr />
<h2 id="sudo-rules-from-the-directory">Sudo Rules from the Directory</h2>
<pre><code class="" data-line=""># Create a sudo rule
ipa sudorule-add allow-sre-sudo \
  --cmdcat=all \
  --desc &quot;SRE team gets full sudo on production&quot;
ipa sudorule-add-user allow-sre-sudo --groups=sre-team
ipa sudorule-add-host allow-sre-sudo --hostgroups=production-servers

# Or a scoped rule — only specific commands
ipa sudorule-add allow-service-restart
ipa sudocmdgroup-add service-commands
ipa sudocmd-add /usr/bin/systemctl
ipa sudocmdgroup-add-member service-commands --sudocmds=&quot;/usr/bin/systemctl&quot;
ipa sudorule-add-allow-command allow-service-restart --sudocmdgroups=service-commands
</code></pre>
<p>On enrolled hosts, SSSD&#8217;s <code class="" data-line="">sssd_sudo</code> responder pulls these rules and the <code class="" data-line="">sudo</code> command evaluates them locally. No <code class="" data-line="">/etc/sudoers.d/</code> files. Central policy, local enforcement.</p>
<hr />
<h2 id="enrolling-a-client">Enrolling a Client</h2>
<pre><code class="" data-line=""># On the client machine
dnf install -y freeipa-client

ipa-client-install \
  --domain=corp.com \
  --server=ipa.corp.com \
  --realm=CORP.COM \
  --principal=admin \
  --password=Admin_password \
  --unattended

# What this does:
# 1. Registers the host in IPA as a machine principal
# 2. Retrieves a host Kerberos keytab (/etc/krb5.keytab)
# 3. Configures SSSD (sssd.conf, nsswitch.conf, pam.d)
# 4. Configures Kerberos (/etc/krb5.conf)
# 5. Optionally configures NTP and DNS
</code></pre>
<p>After enrollment: <code class="" data-line="">getent passwd vamshi</code> returns the IPA user. SSH with an IPA password works. HBAC rules are enforced. Sudo rules from the directory apply. SSH public keys from the user&#8217;s IPA profile work without <code class="" data-line="">authorized_keys</code> files.</p>
<hr />
<h2 id="freeipa-trust-with-active-directory">FreeIPA Trust with Active Directory</h2>
<p>In mixed environments (Linux servers + Windows clients), you can establish a trust between FreeIPA and AD without joining the Linux servers to the AD domain directly.</p>
<pre><code class="" data-line=""># On the IPA server (after installing ipa-server-trust-ad)
ipa-adtrust-install --netbios-name=CORP

# Establish the trust
ipa trust-add ad.corp.com \
  --admin=Administrator \
  --password \
  --type=ad

# AD users can now log in to IPA-enrolled Linux hosts
# They appear as: CORP.COM\username or username@corp.com
</code></pre>
<p>Under the hood: FreeIPA acts as an SSSD-enabled Samba DC for the trust relationship. AD users&#8217; Kerberos tickets from the AD KDC are accepted by the FreeIPA KDC, which maps them to POSIX attributes stored in IPA (or automatically generated via ID mapping).</p>
<hr />
<h2 id="common-misconceptions"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/26a0.png" alt="⚠" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Common Misconceptions</h2>
<p><strong>&#8220;FreeIPA is just OpenLDAP with a UI.&#8221;</strong> FreeIPA uses 389-DS (not OpenLDAP), adds a full Kerberos KDC, a certificate authority, DNS, HBAC enforcement, and sudo management — all with a consistent schema designed for these use cases. It&#8217;s an integrated identity platform, not a wrapper.</p>
<p><strong>&#8220;HBAC rules replace firewall rules.&#8221;</strong> HBAC controls who can log in to a host at the authentication layer — not network access. A blocked HBAC rule means the SSH session is rejected after TCP connection. You still need firewall rules to block TCP access.</p>
<p><strong>&#8220;FreeIPA replicas are identical.&#8221;</strong> FreeIPA uses 389-DS Multi-Supplier replication. All replicas accept reads and writes. But the CA is separate — only the initial server (and explicitly designated CA replicas) run the CA. If the CA goes down, certificate operations stop; authentication does not.</p>
<hr />
<h2 id="framework-alignment">Framework Alignment</h2>
<table>
<thead>
<tr>
<th>Domain</th>
<th>Relevance</th>
</tr>
</thead>
<tbody>
<tr>
<td>CISSP Domain 5: Identity and Access Management</td>
<td>FreeIPA is an enterprise IAM platform — HBAC, sudo policy, SSH key management, and certificate-based authentication are all IAM controls</td>
</tr>
<tr>
<td>CISSP Domain 3: Security Architecture and Engineering</td>
<td>FreeIPA&#8217;s integrated CA enables certificate-based authentication for machines and users — a stronger authentication factor than passwords</td>
</tr>
<tr>
<td>CISSP Domain 1: Security and Risk Management</td>
<td>Centralized HBAC and sudo policy reduces the attack surface of privilege escalation — no more inconsistent sudoers files that drift across the fleet</td>
</tr>
</tbody>
</table>
<hr />
<h2 id="key-takeaways">Key Takeaways</h2>
<ul>
<li>FreeIPA = 389-DS + MIT Kerberos + Dogtag PKI + Bind DNS — one installer, one management interface</li>
<li>HBAC rules define centrally who can SSH to which host groups — enforced by SSSD on every enrolled client, no per-machine config</li>
<li>Sudo rules from the directory replace scattered <code class="" data-line="">/etc/sudoers.d/</code> files — central policy, SSSD-enforced locally</li>
<li><code class="" data-line="">ipa hbactest</code> lets you verify access rules before a user hits a blocked login — use it before every policy change</li>
<li>For Linux-centric environments: FreeIPA. For Windows-dominant environments: AD. For mixed: FreeIPA trust with AD.</li>
</ul>
<hr />
<h2 id="whats-next">What&#8217;s Next</h2>
<p>FreeIPA is the Linux answer to enterprise identity. EP09 covers the Microsoft answer — Active Directory — which extended LDAP and Kerberos into a complete enterprise platform with Group Policy, Sites, and a replication model built for global scale.</p>
<p><em>Next: <a href="/active-directory-ldap-kerberos/">How Active Directory Works: LDAP, Kerberos, and Group Policy Under the Hood</a></em></p>
<p>Get EP09 in your inbox when it publishes → <a href="https://linuxcent.com/subscribe">linuxcent.com/subscribe</a></p>
<p><a class="a2a_button_mastodon" href="https://www.addtoany.com/add_to/mastodon?linkurl=https%3A%2F%2Flinuxcent.com%2Ffreeipa-linux-identity-management%2F&amp;linkname=FreeIPA%3A%20LDAP%20%2B%20Kerberos%20%2B%20PKI%20in%20a%20Single%20Linux%20Identity%20Stack" title="Mastodon" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_email" href="https://www.addtoany.com/add_to/email?linkurl=https%3A%2F%2Flinuxcent.com%2Ffreeipa-linux-identity-management%2F&amp;linkname=FreeIPA%3A%20LDAP%20%2B%20Kerberos%20%2B%20PKI%20in%20a%20Single%20Linux%20Identity%20Stack" title="Email" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_whatsapp" href="https://www.addtoany.com/add_to/whatsapp?linkurl=https%3A%2F%2Flinuxcent.com%2Ffreeipa-linux-identity-management%2F&amp;linkname=FreeIPA%3A%20LDAP%20%2B%20Kerberos%20%2B%20PKI%20in%20a%20Single%20Linux%20Identity%20Stack" title="WhatsApp" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Flinuxcent.com%2Ffreeipa-linux-identity-management%2F&amp;linkname=FreeIPA%3A%20LDAP%20%2B%20Kerberos%20%2B%20PKI%20in%20a%20Single%20Linux%20Identity%20Stack" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_x" href="https://www.addtoany.com/add_to/x?linkurl=https%3A%2F%2Flinuxcent.com%2Ffreeipa-linux-identity-management%2F&amp;linkname=FreeIPA%3A%20LDAP%20%2B%20Kerberos%20%2B%20PKI%20in%20a%20Single%20Linux%20Identity%20Stack" title="X" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Flinuxcent.com%2Ffreeipa-linux-identity-management%2F&amp;linkname=FreeIPA%3A%20LDAP%20%2B%20Kerberos%20%2B%20PKI%20in%20a%20Single%20Linux%20Identity%20Stack" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_copy_link" href="https://www.addtoany.com/add_to/copy_link?linkurl=https%3A%2F%2Flinuxcent.com%2Ffreeipa-linux-identity-management%2F&amp;linkname=FreeIPA%3A%20LDAP%20%2B%20Kerberos%20%2B%20PKI%20in%20a%20Single%20Linux%20Identity%20Stack" title="Copy Link" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Flinuxcent.com%2Ffreeipa-linux-identity-management%2F&#038;title=FreeIPA%3A%20LDAP%20%2B%20Kerberos%20%2B%20PKI%20in%20a%20Single%20Linux%20Identity%20Stack" data-a2a-url="https://linuxcent.com/freeipa-linux-identity-management/" data-a2a-title="FreeIPA: LDAP + Kerberos + PKI in a Single Linux Identity Stack"></a></p><p>The post <a href="https://linuxcent.com/freeipa-linux-identity-management/">FreeIPA: LDAP + Kerberos + PKI in a Single Linux Identity Stack</a> appeared first on <a href="https://linuxcent.com">Linuxcent</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://linuxcent.com/freeipa-linux-identity-management/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1793</post-id>	</item>
		<item>
		<title>LDAP High Availability: Load Balancing and Production Architecture</title>
		<link>https://linuxcent.com/ldap-high-availability/</link>
					<comments>https://linuxcent.com/ldap-high-availability/#respond</comments>
		
		<dc:creator><![CDATA[Vamshi Krishna Santhapuri]]></dc:creator>
		<pubDate>Wed, 06 May 2026 05:00:00 +0000</pubDate>
				<category><![CDATA[Identity & Authentication]]></category>
		<category><![CDATA[Directory Services]]></category>
		<category><![CDATA[HAProxy]]></category>
		<category><![CDATA[High Availability]]></category>
		<category><![CDATA[LDAP]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[OpenLDAP]]></category>
		<category><![CDATA[Security]]></category>
		<guid isPermaLink="false">https://linuxcent.com/?p=1790</guid>

					<description><![CDATA[<p><span class="span-reading-time rt-reading-time" style="display: block;"><span class="rt-label rt-prefix">Reading Time: </span> <span class="rt-time"> 6</span> <span class="rt-label rt-postfix">minutes</span></span>LDAP high availability architecture: HAProxy load balancing, read/write split, connection pooling, cn=monitor metrics, and what to watch for at 10M+ entries.</p>
<p>The post <a href="https://linuxcent.com/ldap-high-availability/">LDAP High Availability: Load Balancing and Production Architecture</a> appeared first on <a href="https://linuxcent.com">Linuxcent</a>.</p>
]]></description>
										<content:encoded><![CDATA[<span class="span-reading-time rt-reading-time" style="display: block;"><span class="rt-label rt-prefix">Reading Time: </span> <span class="rt-time"> 6</span> <span class="rt-label rt-postfix">minutes</span></span><style>
pre{position:relative;background:#1e1e1e;color:#d4d4d4;
    padding:16px 16px 16px 20px;border-radius:6px;overflow-x:auto;
    font-family:'JetBrains Mono','Fira Code','Cascadia Code',Consolas,'Courier New',monospace;
    font-size:.88em;line-height:1.6;border-left:4px solid #555}
code{background:#f4f4f4;padding:2px 5px;border-radius:3px;font-size:.9em}
pre code{background:transparent;padding:0;color:inherit}
pre[data-lang="bash"],pre[data-lang="sh"],
pre[data-lang="shell"],pre[data-lang="zsh"]{border-left-color:#4ec9b0}
pre[data-lang="yaml"],pre[data-lang="json"],
pre[data-lang="toml"],pre[data-lang="xml"]{border-left-color:#569cd6}
pre[data-lang="python"],pre[data-lang="go"],pre[data-lang="rust"],
pre[data-lang="java"],pre[data-lang="c"],pre[data-lang="cpp"]{border-left-color:#c586c0}
pre[data-lang="text"],pre[data-lang="output"],
pre[data-lang="console"]{border-left-color:#888}
.lc-copy-btn{position:absolute;top:8px;right:8px;background:#2d2d2d;color:#ccc;
    border:1px solid #444;border-radius:4px;padding:3px 9px;font-size:.75em;
    font-family:system-ui,sans-serif;cursor:pointer;opacity:0;
    transition:opacity .15s,background .15s;line-height:1.6}
pre:hover .lc-copy-btn{opacity:1}
.lc-copy-btn:hover{background:#3a3a3a;color:#fff}
.lc-copy-btn.copied{color:#4ec9b0;border-color:#4ec9b0}
.lc-lang-badge{position:absolute;top:8px;left:20px;font-family:system-ui,sans-serif;
    font-size:.7em;color:#666;text-transform:uppercase;letter-spacing:.04em;
    line-height:1;pointer-events:none;opacity:0;transition:opacity .15s}
pre:hover .lc-lang-badge{opacity:1}
table{border-collapse:collapse;width:100%;margin:16px 0}
th,td{border:1px solid #ddd;padding:10px 14px;text-align:left}
th{background:#f0f0f0;font-weight:600}
tr:nth-child(even){background:#fafafa}
</style>
<p><script>
(function(){
  if(window.__lcCodeEnhanced)return;
  window.__lcCodeEnhanced=true;
  function enhance(){
    document.querySelectorAll('pre').forEach(function(pre){
      var code=pre.querySelector('code');
      var lang='';
      if(code){var m=(code.className||'').match(/language-(\S+)/);if(m)lang=m[1].toLowerCase();}
      if(lang)pre.setAttribute('data-lang',lang);
      if(lang){var badge=document.createElement('span');badge.className='lc-lang-badge';badge.textContent=lang;pre.insertBefore(badge,pre.firstChild);}
      var btn=document.createElement('button');
      btn.className='lc-copy-btn';btn.textContent='Copy';btn.setAttribute('aria-label','Copy code to clipboard');
      pre.appendChild(btn);
      btn.addEventListener('click',function(){
        var text=code?code.innerText:pre.innerText;
        if(navigator.clipboard&&window.isSecureContext){
          navigator.clipboard.writeText(text).then(function(){ok(btn);}).catch(function(){fb(text,btn);});
        }else{fb(text,btn);}
      });
    });
  }
  function ok(btn){btn.textContent='Copied!';btn.classList.add('copied');setTimeout(function(){btn.textContent='Copy';btn.classList.remove('copied');},2000);}
  function fb(text,btn){
    try{var ta=document.createElement('textarea');ta.value=text;ta.style.cssText='position:fixed;left:-9999px;top:-9999px;opacity:0';document.body.appendChild(ta);ta.select();document.execCommand('copy');document.body.removeChild(ta);ok(btn);}
    catch(e){btn.textContent='✗ Failed';setTimeout(function(){btn.textContent='Copy';},2000);}
  }
  if(document.readyState==='loading'){document.addEventListener('DOMContentLoaded',enhance);}else{enhance();}
})();
</script></p>
<p><em>The Identity Stack, Episode 7</em><br />
<a href="/openldap-setup-replication/">EP06: OpenLDAP</a> → <strong>EP07</strong> → <a href="/freeipa-linux-identity-management/">EP08: FreeIPA</a> → &#8230;</p>
<hr />
<h2 id="tldr">TL;DR</h2>
<ul>
<li>LDAP HA means multiple directory servers behind a load balancer — clients connect to a VIP, not to individual servers</li>
<li>Read/write split: all writes go to the provider, reads are distributed across consumers — the load balancer enforces this by routing on port or backend check</li>
<li>SSSD handles multi-server failover natively (<code class="" data-line="">ldap_uri</code> accepts a comma-separated list) — for apps without built-in failover, HAProxy with health checks does the work</li>
<li>Connection pooling is critical at scale — <code class="" data-line="">nss_ldap</code> and <code class="" data-line="">pam_ldap</code> opened a new connection per login; SSSD maintains a pool; apps that use libldap directly must implement their own</li>
<li><code class="" data-line="">cn=monitor</code> is the built-in monitoring endpoint — exposes connection counts, operation rates, and backend stats readable via <code class="" data-line="">ldapsearch</code></li>
<li>389-DS (Red Hat Directory Server) is the production choice for &gt;1M entries — purpose-built for large directories with a dedicated replication engine</li>
</ul>
<hr />
<h2 id="the-big-picture-production-ldap-topology">The Big Picture: Production LDAP Topology</h2>
<pre><code class="" data-line="">         Clients (SSSD, apps, VPN concentrators)
                      │
              ┌───────▼───────┐
              │   HAProxy VIP  │   ← single endpoint, port 389/636
              │  10.0.0.10     │
              └───────┬───────┘
                      │
          ┌───────────┼───────────┐
          ▼           ▼           ▼
   ldap1.corp.com  ldap2.corp.com  ldap3.corp.com
   (Provider)      (Consumer)      (Consumer)
   Reads + Writes  Reads only      Reads only
          │           ▲               ▲
          └───────────┴───────────────┘
               SyncRepl replication
</code></pre>
<p>EP06 built a two-node replicated directory. This episode covers what happens when the directory becomes infrastructure — when it needs to survive a node failure, handle thousands of connections, and be monitored like any other critical service.</p>
<hr />
<h2 id="haproxy-for-ldap">HAProxy for LDAP</h2>
<p>HAProxy is the standard choice for LDAP load balancing. Unlike HTTP, LDAP is a stateful protocol — once a client binds, subsequent operations on that connection share the authenticated session. The load balancer must use connection persistence, not per-request routing.</p>
<pre><code class="" data-line=""># /etc/haproxy/haproxy.cfg

global
    log /dev/log local0
    maxconn 50000

defaults
    mode tcp                  # LDAP is TCP, not HTTP
    timeout connect 5s
    timeout client  30s
    timeout server  30s
    option tcplog

# ── LDAP read/write split ─────────────────────────────────────────────

# Writes → provider only
frontend ldap-write
    bind *:389
    default_backend ldap-provider

backend ldap-provider
    balance first                   # always use first available (provider)
    option tcp-check
    tcp-check connect
    server ldap1 ldap1.corp.com:389 check inter 5s rise 2 fall 3
    server ldap2 ldap2.corp.com:389 check inter 5s rise 2 fall 3 backup

# Reads → all nodes round-robin
frontend ldap-read
    bind *:3389                     # internal read port
    default_backend ldap-consumers

backend ldap-consumers
    balance roundrobin
    option tcp-check
    tcp-check connect
    server ldap1 ldap1.corp.com:389 check inter 5s
    server ldap2 ldap2.corp.com:389 check inter 5s
    server ldap3 ldap3.corp.com:389 check inter 5s

# LDAPS (TLS)
frontend ldaps
    bind *:636
    default_backend ldap-consumers-tls

backend ldap-consumers-tls
    balance roundrobin
    server ldap1 ldap1.corp.com:636 check inter 5s ssl verify required ca-file /etc/ssl/certs/ca.pem
    server ldap2 ldap2.corp.com:636 check inter 5s ssl verify required ca-file /etc/ssl/certs/ca.pem
</code></pre>
<p>The health check (<code class="" data-line="">tcp-check connect</code>) just verifies TCP connectivity. For a more precise check — verifying that <code class="" data-line="">slapd</code> is actually responding to LDAP requests — use a custom script that runs <code class="" data-line="">ldapsearch</code> and checks the result code.</p>
<hr />
<h2 id="sssd-multi-server-failover">SSSD Multi-Server Failover</h2>
<p>SSSD has native failover — no load balancer required for SSSD-based clients:</p>
<pre><code class="" data-line=""># /etc/sssd/sssd.conf
[domain/corp.com]
ldap_uri = ldap://ldap1.corp.com, ldap://ldap2.corp.com, ldap://ldap3.corp.com
# SSSD tries them in order; switches to next on failure
# Switches back to primary after ldap_recovery_interval (default: 30s)

# For AD, discovery via DNS SRV records is even better:
ad_server = _srv_
# SSSD queries _ldap._tcp.corp.com SRV records and gets all DCs automatically
</code></pre>
<p>SSSD monitors the connection health. If the current server becomes unreachable, it switches to the next in the list within seconds. Existing cached data keeps serving during the switchover. Clients using SSSD don&#8217;t need a load balancer for basic HA.</p>
<hr />
<h2 id="connection-pooling">Connection Pooling</h2>
<p>Every LDAP bind creates an authenticated session on the server. A server with connection limits (<code class="" data-line="">olcConnMaxPending</code>, <code class="" data-line="">olcConnMaxPendingAuth</code> in OLC) will reject new connections when those limits are hit.</p>
<p>The problem: applications that use <code class="" data-line="">libldap</code> directly tend to open a new connection per operation. At 500 requests/second, that&#8217;s 500 new TCP connections, 500 binds, 500 TLS handshakes per second — a directory that can handle 5000 concurrent connections starts refusing new ones.</p>
<p>The solutions:</p>
<p><strong>SSSD</strong> — handles this automatically. SSSD maintains one or a small number of persistent connections per domain and multiplexes all PAM/NSS queries through them.</p>
<p><strong>Application-level pooling</strong> — frameworks like <code class="" data-line="">python-ldap</code> with connection pooling, <code class="" data-line="">ldap3</code> with connection strategies, or dedicated middleware like <code class="" data-line="">389-DS</code>&#8216;s Directory Proxy Server.</p>
<p><strong><code class="" data-line="">ldap_maxconnections</code></strong> in OpenLDAP — sets a hard limit. When hit, new connections block until existing ones close. Set this to something reasonable (<code class="" data-line="">olcConnMaxPending: 100</code> in OLC) so you get a controlled failure mode instead of unbounded queuing.</p>
<hr />
<h2 id="monitoring-with-cnmonitor">Monitoring with cn=monitor</h2>
<p>OpenLDAP exposes live operational statistics via the <code class="" data-line="">cn=monitor</code> database — a virtual LDAP subtree that reflects the server&#8217;s current state. Enable it:</p>
<pre><code class="" data-line=""># enable-monitor.ldif
dn: cn=module,cn=config
objectClass: olcModuleList
cn: module
olcModulePath: /usr/lib/ldap
olcModuleLoad: back_monitor

dn: olcDatabase=monitor,cn=config
objectClass: olcDatabaseConfig
olcDatabase: monitor
olcAccess: to *
  by dn=&quot;cn=admin,dc=corp,dc=com&quot; read
  by * none
</code></pre>
<p>Query it:</p>
<pre><code class="" data-line=""># Overall statistics
ldapsearch -x -H ldap://localhost \
  -D &quot;cn=admin,dc=corp,dc=com&quot; -w password \
  -b &quot;cn=monitor&quot; -s sub &quot;(objectClass=*)&quot; \
  monitorOpInitiated monitorOpCompleted

# Connection counts
ldapsearch -x -H ldap://localhost \
  -D &quot;cn=admin,dc=corp,dc=com&quot; -w password \
  -b &quot;cn=Connections,cn=monitor&quot; -s one \
  monitorConnectionNumber

# Operations by type
ldapsearch -x -H ldap://localhost \
  -D &quot;cn=admin,dc=corp,dc=com&quot; -w password \
  -b &quot;cn=Operations,cn=monitor&quot; -s one \
  monitorOpInitiated monitorOpCompleted
</code></pre>
<p>Useful metrics to export to Prometheus (via <code class="" data-line="">prometheus-openldap-exporter</code> or similar):<br />
&#8211; <code class="" data-line="">monitorOpCompleted</code> per operation type (bind, search, modify)<br />
&#8211; <code class="" data-line="">monitorConnectionNumber</code> — current connection count<br />
&#8211; Backend-specific: <code class="" data-line="">olmMDBEntries</code>, <code class="" data-line="">olmMDBPagesMax</code>, <code class="" data-line="">olmMDBPagesUsed</code></p>
<hr />
<h2 id="389-ds-ldap-at-scale">389-DS: LDAP at Scale</h2>
<p>OpenLDAP is excellent for directories up to a few million entries. When you need:<br />
&#8211; 10M+ entries<br />
&#8211; High write throughput (more than a few hundred writes/second)<br />
&#8211; Fine-grained replication filtering<br />
&#8211; A dedicated web-based admin UI</p>
<p>…389-DS (Red Hat Directory Server, community edition) is the production answer. It&#8217;s what FreeIPA uses under the hood.</p>
<p>Key architectural differences from OpenLDAP:</p>
<p><strong>Multi-supplier replication</strong> — 389-DS&#8217;s replication engine uses a dedicated changelog (stored in LMDB) and Change Sequence Numbers (CSNs) for conflict resolution. Multi-supplier (multi-master) replication is first-class, not a bolted-on feature.</p>
<p><strong>Changelog</strong> — every change is written to a persistent changelog before being applied. This enables precise replication: a consumer can reconnect after a network partition and get exactly the changes it missed, rather than doing a full resync.</p>
<p><strong>Plugin architecture</strong> — 389-DS functionality (replication, managed entries, DNA for automatic UID allocation, memberOf, password policy) is all implemented as plugins that can be enabled/disabled per directory instance.</p>
<pre><code class="" data-line=""># Install 389-DS
dnf install -y 389-ds-base

# Create a new instance
dscreate interactive
# — or use a template:
dscreate from-file /path/to/instance.inf

# Manage with dsctl
dsctl slapd-corp status
dsctl slapd-corp start
dsctl slapd-corp stop

# Admin with dsconf
dsconf slapd-corp backend suffix list
dsconf slapd-corp replication status -suffix &quot;dc=corp,dc=com&quot;
</code></pre>
<p>The <code class="" data-line="">dsconf replication status</code> command gives a live view of replication lag across all suppliers and consumers — something OpenLDAP requires you to compute manually from contextCSN comparisons.</p>
<hr />
<h2 id="global-catalog-cross-domain-search-in-ad">Global Catalog: Cross-Domain Search in AD</h2>
<p>When your directory spans multiple AD domains in a forest, the Global Catalog solves a specific problem: a user in <code class="" data-line="">emea.corp.com</code> needs to be found by an app that only knows <code class="" data-line="">corp.com</code>.</p>
<pre><code class="" data-line="">Forest: corp.com
  ├── corp.com       → DC port 389    full directory: 500K entries
  ├── emea.corp.com  → DC port 389    full directory: 200K entries
  └── Global Catalog → GC port 3268  partial replica: 700K entries
                                       (not all attributes — just the most queried ones)
</code></pre>
<p>The GC replicates a subset of attributes from every domain in the forest. By default: <code class="" data-line="">cn</code>, <code class="" data-line="">mail</code>, <code class="" data-line="">sAMAccountName</code>, <code class="" data-line="">userPrincipalName</code>, <code class="" data-line="">memberOf</code>, and about 150 others. Attributes marked with <code class="" data-line="">isMemberOfPartialAttributeSet</code> in the schema are replicated to the GC.</p>
<p>If an application is configured to use port 3268 instead of 389, it&#8217;s using the GC — and it won&#8217;t see attributes not included in the partial attribute set. This surprises teams that add a custom attribute to AD and then wonder why their application can&#8217;t see it on 3268 but can on 389.</p>
<hr />
<h2 id="production-gotchas"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/26a0.png" alt="⚠" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Production Gotchas</h2>
<p><strong>HAProxy TCP health checks don&#8217;t verify LDAP is responsive.</strong> A server can accept TCP connections but have <code class="" data-line="">slapd</code> in a degraded state (database corruption, out-of-memory). Build a proper LDAP health check: a script that binds and searches a known entry and checks the result.</p>
<p><strong>replication lag under write load.</strong> SyncRepl consumers can fall behind under sustained write load. Monitor the contextCSN difference between provider and consumers. If consumers are more than a few seconds behind, investigate the provider&#8217;s write throughput and the consumer&#8217;s processing speed.</p>
<p><strong>Directory size and the MDB mapsize.</strong> LMDB requires a pre-configured maximum database size (<code class="" data-line="">olcDbMaxSize</code>). If the database grows beyond this, <code class="" data-line="">slapd</code> starts failing writes. Set it to 2–4x your expected data size and monitor <code class="" data-line="">olmMDBPagesUsed / olmMDBPagesMax</code>.</p>
<hr />
<h2 id="key-takeaways">Key Takeaways</h2>
<ul>
<li>HAProxy in TCP mode provides LDAP load balancing — use <code class="" data-line="">balance first</code> for write routing (provider only), <code class="" data-line="">balance roundrobin</code> for reads</li>
<li>SSSD has native failover via <code class="" data-line="">ldap_uri</code> — for SSSD clients, a load balancer adds HA but isn&#8217;t strictly required</li>
<li><code class="" data-line="">cn=monitor</code> is the built-in OpenLDAP monitoring endpoint — export its counters to Prometheus for operational visibility</li>
<li>389-DS is the right choice for &gt;1M entries, high write throughput, or multi-supplier replication as a first-class feature</li>
<li>Global Catalog (port 3268/3269) is a partial replica of all AD domains — useful for forest-wide searches, but missing non-replicated attributes</li>
</ul>
<hr />
<h2 id="whats-next">What&#8217;s Next</h2>
<p>EP07 covers the infrastructure layer. EP08 zooms out to FreeIPA — what you get when LDAP, Kerberos, DNS, PKI, and HBAC are integrated into a single Linux-native identity stack, and why most Linux shops running their own directory should be running FreeIPA instead of bare OpenLDAP.</p>
<p><em>Next: <a href="/freeipa-linux-identity-management/">FreeIPA: LDAP + Kerberos + PKI in a Single Linux Identity Stack</a></em></p>
<p>Get EP08 in your inbox when it publishes → <a href="https://linuxcent.com/subscribe">linuxcent.com/subscribe</a></p>
<p><a class="a2a_button_mastodon" href="https://www.addtoany.com/add_to/mastodon?linkurl=https%3A%2F%2Flinuxcent.com%2Fldap-high-availability%2F&amp;linkname=LDAP%20High%20Availability%3A%20Load%20Balancing%20and%20Production%20Architecture" title="Mastodon" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_email" href="https://www.addtoany.com/add_to/email?linkurl=https%3A%2F%2Flinuxcent.com%2Fldap-high-availability%2F&amp;linkname=LDAP%20High%20Availability%3A%20Load%20Balancing%20and%20Production%20Architecture" title="Email" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_whatsapp" href="https://www.addtoany.com/add_to/whatsapp?linkurl=https%3A%2F%2Flinuxcent.com%2Fldap-high-availability%2F&amp;linkname=LDAP%20High%20Availability%3A%20Load%20Balancing%20and%20Production%20Architecture" title="WhatsApp" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Flinuxcent.com%2Fldap-high-availability%2F&amp;linkname=LDAP%20High%20Availability%3A%20Load%20Balancing%20and%20Production%20Architecture" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_x" href="https://www.addtoany.com/add_to/x?linkurl=https%3A%2F%2Flinuxcent.com%2Fldap-high-availability%2F&amp;linkname=LDAP%20High%20Availability%3A%20Load%20Balancing%20and%20Production%20Architecture" title="X" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Flinuxcent.com%2Fldap-high-availability%2F&amp;linkname=LDAP%20High%20Availability%3A%20Load%20Balancing%20and%20Production%20Architecture" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_copy_link" href="https://www.addtoany.com/add_to/copy_link?linkurl=https%3A%2F%2Flinuxcent.com%2Fldap-high-availability%2F&amp;linkname=LDAP%20High%20Availability%3A%20Load%20Balancing%20and%20Production%20Architecture" title="Copy Link" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Flinuxcent.com%2Fldap-high-availability%2F&#038;title=LDAP%20High%20Availability%3A%20Load%20Balancing%20and%20Production%20Architecture" data-a2a-url="https://linuxcent.com/ldap-high-availability/" data-a2a-title="LDAP High Availability: Load Balancing and Production Architecture"></a></p><p>The post <a href="https://linuxcent.com/ldap-high-availability/">LDAP High Availability: Load Balancing and Production Architecture</a> appeared first on <a href="https://linuxcent.com">Linuxcent</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://linuxcent.com/ldap-high-availability/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1790</post-id>	</item>
		<item>
		<title>OpenLDAP Setup and Replication: Running Your Own Directory</title>
		<link>https://linuxcent.com/openldap-setup-replication/</link>
					<comments>https://linuxcent.com/openldap-setup-replication/#respond</comments>
		
		<dc:creator><![CDATA[Vamshi Krishna Santhapuri]]></dc:creator>
		<pubDate>Tue, 05 May 2026 05:00:00 +0000</pubDate>
				<category><![CDATA[Identity & Authentication]]></category>
		<category><![CDATA[Directory Services]]></category>
		<category><![CDATA[LDAP]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[OpenLDAP]]></category>
		<category><![CDATA[Replication]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[SyncRepl]]></category>
		<guid isPermaLink="false">https://linuxcent.com/?p=1787</guid>

					<description><![CDATA[<p><span class="span-reading-time rt-reading-time" style="display: block;"><span class="rt-label rt-prefix">Reading Time: </span> <span class="rt-time"> 5</span> <span class="rt-label rt-postfix">minutes</span></span>Set up OpenLDAP with SyncRepl replication, OLC (cn=config), and MDB backend. Hands-on guide for a production-ready two-node replicated directory.</p>
<p>The post <a href="https://linuxcent.com/openldap-setup-replication/">OpenLDAP Setup and Replication: Running Your Own Directory</a> appeared first on <a href="https://linuxcent.com">Linuxcent</a>.</p>
]]></description>
										<content:encoded><![CDATA[<span class="span-reading-time rt-reading-time" style="display: block;"><span class="rt-label rt-prefix">Reading Time: </span> <span class="rt-time"> 5</span> <span class="rt-label rt-postfix">minutes</span></span><style>
pre{position:relative;background:#1e1e1e;color:#d4d4d4;
    padding:16px 16px 16px 20px;border-radius:6px;overflow-x:auto;
    font-family:'JetBrains Mono','Fira Code','Cascadia Code',Consolas,'Courier New',monospace;
    font-size:.88em;line-height:1.6;border-left:4px solid #555}
code{background:#f4f4f4;padding:2px 5px;border-radius:3px;font-size:.9em}
pre code{background:transparent;padding:0;color:inherit}
pre[data-lang="bash"],pre[data-lang="sh"],
pre[data-lang="shell"],pre[data-lang="zsh"]{border-left-color:#4ec9b0}
pre[data-lang="yaml"],pre[data-lang="json"],
pre[data-lang="toml"],pre[data-lang="xml"]{border-left-color:#569cd6}
pre[data-lang="python"],pre[data-lang="go"],pre[data-lang="rust"],
pre[data-lang="java"],pre[data-lang="c"],pre[data-lang="cpp"]{border-left-color:#c586c0}
pre[data-lang="text"],pre[data-lang="output"],
pre[data-lang="console"]{border-left-color:#888}
.lc-copy-btn{position:absolute;top:8px;right:8px;background:#2d2d2d;color:#ccc;
    border:1px solid #444;border-radius:4px;padding:3px 9px;font-size:.75em;
    font-family:system-ui,sans-serif;cursor:pointer;opacity:0;
    transition:opacity .15s,background .15s;line-height:1.6}
pre:hover .lc-copy-btn{opacity:1}
.lc-copy-btn:hover{background:#3a3a3a;color:#fff}
.lc-copy-btn.copied{color:#4ec9b0;border-color:#4ec9b0}
.lc-lang-badge{position:absolute;top:8px;left:20px;font-family:system-ui,sans-serif;
    font-size:.7em;color:#666;text-transform:uppercase;letter-spacing:.04em;
    line-height:1;pointer-events:none;opacity:0;transition:opacity .15s}
pre:hover .lc-lang-badge{opacity:1}
table{border-collapse:collapse;width:100%;margin:16px 0}
th,td{border:1px solid #ddd;padding:10px 14px;text-align:left}
th{background:#f0f0f0;font-weight:600}
tr:nth-child(even){background:#fafafa}
</style>
<p><script>
(function(){
  if(window.__lcCodeEnhanced)return;
  window.__lcCodeEnhanced=true;
  function enhance(){
    document.querySelectorAll('pre').forEach(function(pre){
      var code=pre.querySelector('code');
      var lang='';
      if(code){var m=(code.className||'').match(/language-(\S+)/);if(m)lang=m[1].toLowerCase();}
      if(lang)pre.setAttribute('data-lang',lang);
      if(lang){var badge=document.createElement('span');badge.className='lc-lang-badge';badge.textContent=lang;pre.insertBefore(badge,pre.firstChild);}
      var btn=document.createElement('button');
      btn.className='lc-copy-btn';btn.textContent='Copy';btn.setAttribute('aria-label','Copy code to clipboard');
      pre.appendChild(btn);
      btn.addEventListener('click',function(){
        var text=code?code.innerText:pre.innerText;
        if(navigator.clipboard&&window.isSecureContext){
          navigator.clipboard.writeText(text).then(function(){ok(btn);}).catch(function(){fb(text,btn);});
        }else{fb(text,btn);}
      });
    });
  }
  function ok(btn){btn.textContent='Copied!';btn.classList.add('copied');setTimeout(function(){btn.textContent='Copy';btn.classList.remove('copied');},2000);}
  function fb(text,btn){
    try{var ta=document.createElement('textarea');ta.value=text;ta.style.cssText='position:fixed;left:-9999px;top:-9999px;opacity:0';document.body.appendChild(ta);ta.select();document.execCommand('copy');document.body.removeChild(ta);ok(btn);}
    catch(e){btn.textContent='✗ Failed';setTimeout(function(){btn.textContent='Copy';},2000);}
  }
  if(document.readyState==='loading'){document.addEventListener('DOMContentLoaded',enhance);}else{enhance();}
})();
</script></p>
<p><em>The Identity Stack, Episode 6</em><br />
<a href="/what-is-ldap/">EP01</a> → &#8230; → <a href="/how-kerberos-works-tickets-kdc/">EP05: Kerberos</a> → <strong>EP06</strong> → <a href="/ldap-high-availability-scale/">EP07: LDAP HA</a> → &#8230;</p>
<hr />
<h2 id="tldr">TL;DR</h2>
<ul>
<li>OpenLDAP&#8217;s server process is <code class="" data-line="">slapd</code> — the backend that stores data is MDB (LMDB), a memory-mapped B-tree that replaced the old Berkeley DB backend</li>
<li>Configuration lives in the directory itself: <code class="" data-line="">cn=config</code> (OLC — Online Configuration) lets you modify <code class="" data-line="">slapd</code> at runtime without restarting</li>
<li>SyncRepl is the replication protocol: a consumer subscribes to a provider and stays in sync via either polling (<code class="" data-line="">refreshOnly</code>) or a persistent connection (<code class="" data-line="">refreshAndPersist</code>)</li>
<li>Multi-Provider (formerly Multi-Master) lets multiple nodes accept writes — conflict resolution uses CSN (Change Sequence Number), last-writer-wins</li>
<li>The essential tools: <code class="" data-line="">slapd</code>, <code class="" data-line="">ldapadd</code>, <code class="" data-line="">ldapmodify</code>, <code class="" data-line="">ldapsearch</code>, <code class="" data-line="">slapcat</code>, <code class="" data-line="">slaptest</code></li>
<li>Always build indexes on the attributes you search most — <code class="" data-line="">uid</code>, <code class="" data-line="">cn</code>, <code class="" data-line="">memberOf</code> — or every search is a full scan</li>
</ul>
<hr />
<h2 id="the-big-picture-slapd-architecture">The Big Picture: slapd Architecture</h2>
<pre><code class="" data-line="">ldapsearch / ldapadd / SSSD / any LDAP client
              │ TCP 389 / 636
              ▼
         ┌─────────────────────────────────┐
         │  slapd (OpenLDAP server)         │
         │                                 │
         │  Frontend (protocol layer)       │
         │    • parse BER requests          │
         │    • ACL enforcement             │
         │    • schema validation           │
         │                                 │
         │  Backend (storage layer)         │
         │    • MDB (LMDB) — default       │
         │    • memory-mapped file I/O      │
         │    • ACID transactions           │
         └────────────┬────────────────────┘
                      │
              /var/lib/ldap/
              data.mdb   (the directory data)
              lock.mdb   (LMDB lock file)
</code></pre>
<p>EP05 showed Kerberos in isolation. OpenLDAP is where you run the identity store that Kerberos references — and where SSSD looks up user and group attributes. This episode builds a working two-node replicated directory from scratch.</p>
<hr />
<h2 id="installation">Installation</h2>
<pre><code class="" data-line=""># Ubuntu / Debian
apt-get install -y slapd ldap-utils

# RHEL / Rocky / AlmaLinux
dnf install -y openldap-servers openldap-clients

# After install — Ubuntu runs a configuration wizard
# Skip it: dpkg-reconfigure slapd
# Or answer it and then switch to OLC management
</code></pre>
<p>On RHEL-family systems, <code class="" data-line="">slapd</code> is not configured after install — you work entirely through OLC from the start.</p>
<hr />
<h2 id="olc-the-directory-configures-itself">OLC: The Directory Configures Itself</h2>
<p>The old way was <code class="" data-line="">slapd.conf</code> — a static file that required a full restart on every change. OLC (Online Configuration) replaced it: <code class="" data-line="">slapd</code>&#8216;s own configuration is stored as LDAP entries under <code class="" data-line="">cn=config</code>. You modify configuration the same way you modify data — with <code class="" data-line="">ldapmodify</code>. Changes take effect immediately.</p>
<pre><code class="" data-line="">cn=config                        ← root config entry
├── cn=schema,cn=config          ← schema definitions
│     ├── cn={0}core             ← core schema
│     ├── cn={1}cosine           ← RFC 1274 attributes
│     └── cn={2}inetorgperson    ← inetOrgPerson object class
├── olcDatabase={-1}frontend     ← default settings for all databases
├── olcDatabase={0}config        ← the config database itself
└── olcDatabase={1}mdb           ← your actual directory data
      ├── olcAccess              ← ACLs
      ├── olcSuffix              ← base DN (e.g., dc=corp,dc=com)
      └── olcDbIndex             ← search indexes
</code></pre>
<p>Everything under <code class="" data-line="">cn=config</code> has attributes prefixed with <code class="" data-line="">olc</code> (OpenLDAP Configuration). You query and modify it just like any other LDAP subtree — with one restriction: only the <code class="" data-line="">cn=config</code> admin (usually <code class="" data-line="">gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth</code> — the local root via SASL EXTERNAL) can write to it.</p>
<hr />
<h2 id="bootstrapping-a-directory">Bootstrapping a Directory</h2>
<p>The quickest way to get a working directory is a set of LDIF files applied in order.</p>
<h3 id="1-load-schemas">1. Load schemas</h3>
<pre><code class="" data-line=""># Apply the schemas OpenLDAP ships with
ldapadd -Y EXTERNAL -H ldapi:/// \
  -f /etc/ldap/schema/cosine.ldif
ldapadd -Y EXTERNAL -H ldapi:/// \
  -f /etc/ldap/schema/inetorgperson.ldif
ldapadd -Y EXTERNAL -H ldapi:/// \
  -f /etc/ldap/schema/nis.ldif       # adds posixAccount, posixGroup
</code></pre>
<h3 id="2-configure-the-mdb-database">2. Configure the MDB database</h3>
<pre><code class="" data-line=""># mdb-config.ldif
dn: olcDatabase={1}mdb,cn=config
changetype: modify
replace: olcSuffix
olcSuffix: dc=corp,dc=com
-
replace: olcRootDN
olcRootDN: cn=admin,dc=corp,dc=com
-
replace: olcRootPW
olcRootPW: {SSHA}hashed_password_here
</code></pre>
<p>Generate the hash: <code class="" data-line="">slappasswd -s yourpassword</code></p>
<pre><code class="" data-line="">ldapmodify -Y EXTERNAL -H ldapi:/// -f mdb-config.ldif
</code></pre>
<h3 id="3-add-indexes">3. Add indexes</h3>
<pre><code class="" data-line=""># indexes.ldif
dn: olcDatabase={1}mdb,cn=config
changetype: modify
add: olcDbIndex
olcDbIndex: uid eq,pres
olcDbIndex: cn eq,sub
olcDbIndex: sn eq,sub
olcDbIndex: mail eq
olcDbIndex: memberOf eq
olcDbIndex: entryCSN eq
olcDbIndex: entryUUID eq
</code></pre>
<p>The last two (<code class="" data-line="">entryCSN</code>, <code class="" data-line="">entryUUID</code>) are required for SyncRepl replication to work efficiently.</p>
<h3 id="4-load-initial-data">4. Load initial data</h3>
<pre><code class="" data-line=""># base.ldif
dn: dc=corp,dc=com
objectClass: top
objectClass: dcObject
objectClass: organization
o: Corp
dc: corp

dn: ou=people,dc=corp,dc=com
objectClass: organizationalUnit
ou: people

dn: ou=groups,dc=corp,dc=com
objectClass: organizationalUnit
ou: groups

dn: uid=vamshi,ou=people,dc=corp,dc=com
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: shadowAccount
cn: Vamshi Krishna
sn: Krishna
uid: vamshi
uidNumber: 1001
gidNumber: 1001
homeDirectory: /home/vamshi
loginShell: /bin/bash
mail: vamshi@corp.com
userPassword: {SSHA}hashed_password_here
</code></pre>
<pre><code class="" data-line="">ldapadd -x -H ldap://localhost \
  -D &quot;cn=admin,dc=corp,dc=com&quot; \
  -w adminpassword \
  -f base.ldif
</code></pre>
<hr />
<h2 id="acls-who-can-read-what">ACLs: Who Can Read What</h2>
<p>OpenLDAP ACLs are evaluated top-to-bottom; first match wins.</p>
<pre><code class="" data-line=""># acls.ldif — set via OLC
dn: olcDatabase={1}mdb,cn=config
changetype: modify
replace: olcAccess
# Users can change their own passwords
olcAccess: to attrs=userPassword
  by self write
  by anonymous auth
  by * none
# Users can read their own entry
olcAccess: to dn.base=&quot;ou=people,dc=corp,dc=com&quot;
  by self read
  by users read
  by * none
# Service accounts can read everything (for SSSD)
olcAccess: to *
  by dn=&quot;cn=svc-ldap,ou=services,dc=corp,dc=com&quot; read
  by self read
  by * none
</code></pre>
<p>A service account (<code class="" data-line="">cn=svc-ldap</code>) that SSSD uses to search the directory needs read access to <code class="" data-line="">ou=people</code> and <code class="" data-line="">ou=groups</code>. Never give SSSD admin (write) access.</p>
<hr />
<h2 id="syncrepl-replication">SyncRepl Replication</h2>
<p>SyncRepl is a pull-based replication protocol built on the LDAP Sync operation (RFC 4533). A consumer connects to a provider and requests changes. The provider sends them. The consumer stays in sync.</p>
<h3 id="on-the-provider-enable-the-syncprov-overlay">On the Provider: Enable the syncprov overlay</h3>
<pre><code class="" data-line=""># syncprov.ldif
dn: olcOverlay=syncprov,olcDatabase={1}mdb,cn=config
objectClass: olcOverlayConfig
objectClass: olcSyncProvConfig
olcOverlay: syncprov
olcSpCheckpoint: 100 10     # checkpoint every 100 ops or 10 minutes
olcSpSessionLog: 100        # keep last 100 changes for delta-sync
</code></pre>
<pre><code class="" data-line="">ldapadd -Y EXTERNAL -H ldapi:/// -f syncprov.ldif
</code></pre>
<h3 id="on-the-consumer-configure-syncrepl">On the Consumer: Configure syncrepl</h3>
<pre><code class="" data-line=""># consumer-config.ldif
dn: olcDatabase={1}mdb,cn=config
changetype: modify
add: olcSyncrepl
olcSyncrepl: rid=001
  provider=ldap://ldap1.corp.com:389
  bindmethod=simple
  binddn=&quot;cn=repl-svc,dc=corp,dc=com&quot;
  credentials=replication-password
  searchbase=&quot;dc=corp,dc=com&quot;
  scope=sub
  schemachecking=on
  type=refreshAndPersist    # persistent connection (vs refreshOnly = polling)
  retry=&quot;5 5 60 +&quot;          # retry: 5 times every 5s, then every 60s forever
  interval=00:00:05:00      # (for refreshOnly) sync every 5 minutes
-
add: olcUpdateRef
olcUpdateRef: ldap://ldap1.corp.com   # redirect writes to provider
</code></pre>
<p><code class="" data-line="">refreshAndPersist</code> keeps a persistent connection open. Changes replicate within milliseconds. <code class="" data-line="">refreshOnly</code> polls on an interval — simpler, but adds latency.</p>
<h3 id="verify-replication">Verify Replication</h3>
<pre><code class="" data-line=""># On provider: check the contextCSN (the sync state token)
ldapsearch -x -H ldap://ldap1.corp.com \
  -D &quot;cn=admin,dc=corp,dc=com&quot; -w password \
  -b &quot;dc=corp,dc=com&quot; -s base contextCSN
# contextCSN: 20260427010000.000000Z#000000#000#000000

# On consumer: should match after sync
ldapsearch -x -H ldap://ldap2.corp.com \
  -D &quot;cn=admin,dc=corp,dc=com&quot; -w password \
  -b &quot;dc=corp,dc=com&quot; -s base contextCSN
# Same CSN = in sync
</code></pre>
<hr />
<h2 id="multi-provider-accepting-writes-on-both-nodes">Multi-Provider: Accepting Writes on Both Nodes</h2>
<p>Standard SyncRepl has one provider and one or more consumers — only the provider accepts writes. Multi-Provider (formerly Multi-Master) lets every node accept writes.</p>
<pre><code class="" data-line=""># On each node — add mirrormode to the database config
dn: olcDatabase={1}mdb,cn=config
changetype: modify
add: olcMirrorMode
olcMirrorMode: TRUE
</code></pre>
<p>With mirrormode enabled and each node configured as both provider and consumer of the other, writes on either node replicate to the other. Conflict resolution is CSN-based (Change Sequence Number) — a monotonically increasing timestamp. Last write wins at the attribute level.</p>
<p>Multi-Provider does not prevent split-brain conflicts — if two clients write the same attribute on two different nodes during a network partition, the higher CSN wins when the partition heals. For most directory use cases (user passwords, group memberships), this is acceptable. For others, it requires careful thought.</p>
<hr />
<h2 id="production-gotchas"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/26a0.png" alt="⚠" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Production Gotchas</h2>
<p><strong>MDB data file grows monotonically.</strong> LMDB never shrinks the data file automatically. Deleted entries leave free space inside the file that gets reused, but the file on disk doesn&#8217;t shrink. Use <code class="" data-line="">slapcat</code> to export and <code class="" data-line="">slapadd</code> to reimport if you need to reclaim disk space.</p>
<p><strong><code class="" data-line="">slapcat</code> is the only safe backup.</strong> <code class="" data-line="">slapcat</code> reads the MDB database directly and exports LDIF — it does not go through <code class="" data-line="">slapd</code>. Run it while <code class="" data-line="">slapd</code> is running (LMDB is MVCC-safe for readers), but never copy the raw MDB files while <code class="" data-line="">slapd</code> is running.</p>
<p><strong>Schema changes on a replicated directory require coordination.</strong> Load the new schema on the provider first. SyncRepl will propagate it to consumers — but if a consumer gets a new entry using the new schema before the schema itself is replicated, the import will fail. Load schemas manually on all nodes before adding entries that use them.</p>
<hr />
<h2 id="key-takeaways">Key Takeaways</h2>
<ul>
<li>OpenLDAP uses LMDB (MDB backend) — a memory-mapped, ACID-compliant storage engine with no external dependency</li>
<li>OLC (<code class="" data-line="">cn=config</code>) is the right way to configure <code class="" data-line="">slapd</code> — changes apply without restarts</li>
<li>SyncRepl pulls changes from a provider to a consumer — <code class="" data-line="">refreshAndPersist</code> for near-real-time, <code class="" data-line="">refreshOnly</code> for poll-based</li>
<li>Always index <code class="" data-line="">uid</code>, <code class="" data-line="">cn</code>, <code class="" data-line="">entryCSN</code>, and <code class="" data-line="">entryUUID</code> — unindexed searches are full scans</li>
<li>Multi-Provider allows writes on all nodes with CSN-based last-write-wins conflict resolution</li>
</ul>
<hr />
<h2 id="whats-next">What&#8217;s Next</h2>
<p>A single OpenLDAP server works. Two nodes with SyncRepl work better. EP07 goes further: how you put multiple LDAP servers behind a load balancer, how connection pooling works, what to monitor, and how 389-DS handles directories with tens of millions of entries.</p>
<p><em>Next: <a href="/ldap-high-availability-scale/">LDAP High Availability: Load Balancing and Production Architecture</a></em></p>
<p>Get EP07 in your inbox when it publishes → <a href="https://linuxcent.com/subscribe">linuxcent.com/subscribe</a></p>
<p><a class="a2a_button_mastodon" href="https://www.addtoany.com/add_to/mastodon?linkurl=https%3A%2F%2Flinuxcent.com%2Fopenldap-setup-replication%2F&amp;linkname=OpenLDAP%20Setup%20and%20Replication%3A%20Running%20Your%20Own%20Directory" title="Mastodon" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_email" href="https://www.addtoany.com/add_to/email?linkurl=https%3A%2F%2Flinuxcent.com%2Fopenldap-setup-replication%2F&amp;linkname=OpenLDAP%20Setup%20and%20Replication%3A%20Running%20Your%20Own%20Directory" title="Email" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_whatsapp" href="https://www.addtoany.com/add_to/whatsapp?linkurl=https%3A%2F%2Flinuxcent.com%2Fopenldap-setup-replication%2F&amp;linkname=OpenLDAP%20Setup%20and%20Replication%3A%20Running%20Your%20Own%20Directory" title="WhatsApp" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Flinuxcent.com%2Fopenldap-setup-replication%2F&amp;linkname=OpenLDAP%20Setup%20and%20Replication%3A%20Running%20Your%20Own%20Directory" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_x" href="https://www.addtoany.com/add_to/x?linkurl=https%3A%2F%2Flinuxcent.com%2Fopenldap-setup-replication%2F&amp;linkname=OpenLDAP%20Setup%20and%20Replication%3A%20Running%20Your%20Own%20Directory" title="X" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Flinuxcent.com%2Fopenldap-setup-replication%2F&amp;linkname=OpenLDAP%20Setup%20and%20Replication%3A%20Running%20Your%20Own%20Directory" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_copy_link" href="https://www.addtoany.com/add_to/copy_link?linkurl=https%3A%2F%2Flinuxcent.com%2Fopenldap-setup-replication%2F&amp;linkname=OpenLDAP%20Setup%20and%20Replication%3A%20Running%20Your%20Own%20Directory" title="Copy Link" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Flinuxcent.com%2Fopenldap-setup-replication%2F&#038;title=OpenLDAP%20Setup%20and%20Replication%3A%20Running%20Your%20Own%20Directory" data-a2a-url="https://linuxcent.com/openldap-setup-replication/" data-a2a-title="OpenLDAP Setup and Replication: Running Your Own Directory"></a></p><p>The post <a href="https://linuxcent.com/openldap-setup-replication/">OpenLDAP Setup and Replication: Running Your Own Directory</a> appeared first on <a href="https://linuxcent.com">Linuxcent</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://linuxcent.com/openldap-setup-replication/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1787</post-id>	</item>
		<item>
		<title>How Kerberos Works: Tickets, KDC, and Why Enterprises Use It With LDAP</title>
		<link>https://linuxcent.com/how-kerberos-works/</link>
					<comments>https://linuxcent.com/how-kerberos-works/#respond</comments>
		
		<dc:creator><![CDATA[Vamshi Krishna Santhapuri]]></dc:creator>
		<pubDate>Mon, 04 May 2026 05:00:00 +0000</pubDate>
				<category><![CDATA[Identity & Authentication]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Authentication]]></category>
		<category><![CDATA[Identity Management]]></category>
		<category><![CDATA[Kerberos]]></category>
		<category><![CDATA[LDAP]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<guid isPermaLink="false">https://linuxcent.com/?p=1784</guid>

					<description><![CDATA[<p><span class="span-reading-time rt-reading-time" style="display: block;"><span class="rt-label rt-prefix">Reading Time: </span> <span class="rt-time"> 7</span> <span class="rt-label rt-postfix">minutes</span></span>How Kerberos works: the KDC, TGT flow, ticket-granting service, and why enterprises pair it with LDAP — explained with kinit, klist, and wire-level detail.</p>
<p>The post <a href="https://linuxcent.com/how-kerberos-works/">How Kerberos Works: Tickets, KDC, and Why Enterprises Use It With LDAP</a> appeared first on <a href="https://linuxcent.com">Linuxcent</a>.</p>
]]></description>
										<content:encoded><![CDATA[<span class="span-reading-time rt-reading-time" style="display: block;"><span class="rt-label rt-prefix">Reading Time: </span> <span class="rt-time"> 7</span> <span class="rt-label rt-postfix">minutes</span></span><style>
pre{position:relative;background:#1e1e1e;color:#d4d4d4;
    padding:16px 16px 16px 20px;border-radius:6px;overflow-x:auto;
    font-family:'JetBrains Mono','Fira Code','Cascadia Code',Consolas,'Courier New',monospace;
    font-size:.88em;line-height:1.6;border-left:4px solid #555}
code{background:#f4f4f4;padding:2px 5px;border-radius:3px;font-size:.9em}
pre code{background:transparent;padding:0;color:inherit}
pre[data-lang="bash"],pre[data-lang="sh"],
pre[data-lang="shell"],pre[data-lang="zsh"]{border-left-color:#4ec9b0}
pre[data-lang="yaml"],pre[data-lang="json"],
pre[data-lang="toml"],pre[data-lang="xml"]{border-left-color:#569cd6}
pre[data-lang="python"],pre[data-lang="go"],pre[data-lang="rust"],
pre[data-lang="java"],pre[data-lang="c"],pre[data-lang="cpp"]{border-left-color:#c586c0}
pre[data-lang="text"],pre[data-lang="output"],
pre[data-lang="console"]{border-left-color:#888}
.lc-copy-btn{position:absolute;top:8px;right:8px;background:#2d2d2d;color:#ccc;
    border:1px solid #444;border-radius:4px;padding:3px 9px;font-size:.75em;
    font-family:system-ui,sans-serif;cursor:pointer;opacity:0;
    transition:opacity .15s,background .15s;line-height:1.6}
pre:hover .lc-copy-btn{opacity:1}
.lc-copy-btn:hover{background:#3a3a3a;color:#fff}
.lc-copy-btn.copied{color:#4ec9b0;border-color:#4ec9b0}
.lc-lang-badge{position:absolute;top:8px;left:20px;font-family:system-ui,sans-serif;
    font-size:.7em;color:#666;text-transform:uppercase;letter-spacing:.04em;
    line-height:1;pointer-events:none;opacity:0;transition:opacity .15s}
pre:hover .lc-lang-badge{opacity:1}
table{border-collapse:collapse;width:100%;margin:16px 0}
th,td{border:1px solid #ddd;padding:10px 14px;text-align:left}
th{background:#f0f0f0;font-weight:600}
tr:nth-child(even){background:#fafafa}
</style>
<p><script>
(function(){
  if(window.__lcCodeEnhanced)return;
  window.__lcCodeEnhanced=true;
  function enhance(){
    document.querySelectorAll('pre').forEach(function(pre){
      var code=pre.querySelector('code');
      var lang='';
      if(code){var m=(code.className||'').match(/language-(\S+)/);if(m)lang=m[1].toLowerCase();}
      if(lang)pre.setAttribute('data-lang',lang);
      if(lang){var badge=document.createElement('span');badge.className='lc-lang-badge';badge.textContent=lang;pre.insertBefore(badge,pre.firstChild);}
      var btn=document.createElement('button');
      btn.className='lc-copy-btn';btn.textContent='Copy';btn.setAttribute('aria-label','Copy code to clipboard');
      pre.appendChild(btn);
      btn.addEventListener('click',function(){
        var text=code?code.innerText:pre.innerText;
        if(navigator.clipboard&&window.isSecureContext){
          navigator.clipboard.writeText(text).then(function(){ok(btn);}).catch(function(){fb(text,btn);});
        }else{fb(text,btn);}
      });
    });
  }
  function ok(btn){btn.textContent='Copied!';btn.classList.add('copied');setTimeout(function(){btn.textContent='Copy';btn.classList.remove('copied');},2000);}
  function fb(text,btn){
    try{var ta=document.createElement('textarea');ta.value=text;ta.style.cssText='position:fixed;left:-9999px;top:-9999px;opacity:0';document.body.appendChild(ta);ta.select();document.execCommand('copy');document.body.removeChild(ta);ok(btn);}
    catch(e){btn.textContent='✗ Failed';setTimeout(function(){btn.textContent='Copy';},2000);}
  }
  if(document.readyState==='loading'){document.addEventListener('DOMContentLoaded',enhance);}else{enhance();}
})();
</script></p>
<p><em>The Identity Stack, Episode 5</em><br />
<a href="/what-is-ldap/">EP01</a> → <a href="/ldap-internals-directory-structure/">EP02</a> → <a href="/ldap-authentication-linux-pam-nss/">EP03</a> → <a href="/sssd-linux-authentication/">EP04: SSSD</a> → <strong>EP05</strong> → <a href="/openldap-setup-replication/">EP06: OpenLDAP</a> → &#8230;</p>
<hr />
<h2 id="tldr">TL;DR</h2>
<ul>
<li>Kerberos is a network authentication protocol — it proves identity without sending passwords over the network, using time-limited cryptographic tickets</li>
<li>Three actors: the client, the KDC (Key Distribution Center), and the service — the KDC issues tickets; clients use tickets to authenticate to services</li>
<li>The ticket flow: AS-REQ (get a TGT) → TGS-REQ (exchange TGT for a service ticket) → AP-REQ (present service ticket to the target service)</li>
<li>A TGT (Ticket-Granting Ticket) is a session credential — it lets you request service tickets without re-entering your password for the lifetime of the ticket (default 10 hours)</li>
<li>LDAP + Kerberos together: LDAP stores identity (who you are), Kerberos authenticates it (proves you are who you say you are) — Active Directory is exactly this combination</li>
<li><code class="" data-line="">kinit</code>, <code class="" data-line="">klist</code>, <code class="" data-line="">kdestroy</code> are the hands-on tools — run them and read the ticket output</li>
</ul>
<hr />
<h2 id="the-big-picture-three-actors-three-steps">The Big Picture: Three Actors, Three Steps</h2>
<pre><code class="" data-line="">         1. AS-REQ / AS-REP
Client ◄────────────────────► AS (Authentication Server)
  │                                     │
  │    (part of KDC)                    │
  │                                     ▼
  │         2. TGS-REQ / TGS-REP   TGS (Ticket-Granting Server)
  ├───────────────────────────────────►│
  │         (part of KDC)              │
  │                                    │
  │    3. AP-REQ / AP-REP              │
  └─────────────────────────────► Service (SSH, LDAP, NFS, HTTP...)

KDC = AS + TGS (usually the same process, same machine)
</code></pre>
<p>EP04 mentioned Kerberos tickets and clock skew requirements without explaining the protocol. This episode explains why Kerberos was invented, what a ticket actually is, and how the three-step flow works — so that when SSSD says &#8220;KDC unreachable&#8221; or <code class="" data-line="">kinit</code> fails with &#8220;pre-authentication required,&#8221; you know exactly what&#8217;s happening.</p>
<hr />
<h2 id="the-problem-kerberos-was-built-to-solve">The Problem Kerberos Was Built to Solve</h2>
<p>MIT&#8217;s Project Athena started in 1983 — a campus-wide computing initiative giving students access to thousands of workstations. The problem: how do you authenticate a student at workstation 847 to a file server across campus without sending their password over the network?</p>
<p>In 1988, Steve Miller and Clifford Neuman published Kerberos version 4. The core insight: a trusted third party (the KDC) can issue cryptographic proof that a user has authenticated, and that proof can be presented to any service on the network without the service ever seeing the user&#8217;s password.</p>
<p>The password never leaves the client machine after the initial authentication. Every subsequent authentication — to a different service, to the same service again — uses a ticket. The KDC knows both the client and the service. The client and service only need to trust the KDC.</p>
<hr />
<h2 id="keys-tickets-and-sessions">Keys, Tickets, and Sessions</h2>
<p>Before the protocol, the primitives:</p>
<p><strong>Long-term keys</strong> — derived from passwords. When you set a password in Kerberos, it&#8217;s hashed into a key stored in the KDC database (in the <code class="" data-line="">krbtgt</code> account on AD, in <code class="" data-line="">/var/lib/krb5kdc/principal</code> on MIT Kerberos). The client also derives this key from the password at authentication time. Neither ever sends the raw password.</p>
<p><strong>Session keys</strong> — temporary symmetric keys created by the KDC for a specific session. They&#8217;re valid for the ticket&#8217;s lifetime. After the ticket expires, the session key is useless.</p>
<p><strong>Tickets</strong> — encrypted blobs issued by the KDC. A ticket contains the session key, the client identity, the expiry time, and optional flags. It&#8217;s encrypted with the target service&#8217;s long-term key — only the service can decrypt it. The client carries the ticket but can&#8217;t read the contents.</p>
<hr />
<h2 id="the-three-step-flow">The Three-Step Flow</h2>
<h3 id="step-1-as-req-as-rep-getting-a-tgt">Step 1: AS-REQ / AS-REP — Getting a TGT</h3>
<pre><code class="" data-line="">Client                        KDC (AS component)
  │                                │
  │── AS-REQ ──────────────────────►
  │   {username, timestamp}         │
  │   (timestamp encrypted with     │
  │    client&#039;s long-term key)       │
  │                                 │
  │   KDC verifies: decrypts        │
  │   timestamp with stored key.    │
  │   If valid → issues TGT         │
  │                                 │
  ◄── AS-REP ──────────────────────│
      {session_key_enc_with_client, │
       TGT_enc_with_krbtgt_key}     │
</code></pre>
<p>The client decrypts the session key using its long-term key (derived from the password). The TGT is encrypted with the KDC&#8217;s own key (<code class="" data-line="">krbtgt</code>) — the client can&#8217;t read it, but carries it.</p>
<p>This is the step that requires the password. After this, the TGT is what the client uses for everything else.</p>
<h3 id="step-2-tgs-req-tgs-rep-getting-a-service-ticket">Step 2: TGS-REQ / TGS-REP — Getting a Service Ticket</h3>
<pre><code class="" data-line="">Client                        KDC (TGS component)
  │                                │
  │── TGS-REQ ─────────────────────►
  │   {TGT, authenticator,         │
  │    target_service_name}        │
  │   (authenticator encrypted      │
  │    with TGT session key)        │
  │                                 │
  │   KDC: decrypts TGT,           │
  │   verifies authenticator,       │
  │   issues service ticket         │
  │                                 │
  ◄── TGS-REP ────────────────────│
      {service_session_key_enc,    │
       service_ticket_enc_with_    │
       service_long_term_key}      │
</code></pre>
<p>No password involved. The client proves its identity by presenting the TGT (which only the KDC can issue) and an authenticator (a timestamp encrypted with the TGT&#8217;s session key, proving the client holds the session key without revealing it).</p>
<h3 id="step-3-ap-req-ap-rep-authenticating-to-the-service">Step 3: AP-REQ / AP-REP — Authenticating to the Service</h3>
<pre><code class="" data-line="">Client                        Service (sshd, LDAP, NFS...)
  │                                │
  │── AP-REQ ──────────────────────►
  │   {service_ticket,             │
  │    authenticator_enc_with_      │
  │    service_session_key}        │
  │                                 │
  │   Service: decrypts ticket      │
  │   with its long-term key,       │
  │   verifies authenticator        │
  │                                 │
  ◄── AP-REP (optional) ───────────│
      {mutual authentication}       │
</code></pre>
<p>The service decrypts the ticket using its own key. It extracts the client identity and session key. It verifies the authenticator. No communication with the KDC required — the service trusts what the KDC signed.</p>
<hr />
<h2 id="why-clock-skew-matters">Why Clock Skew Matters</h2>
<p>Every Kerberos authenticator contains a timestamp. The service rejects authenticators older than 5 minutes (by default) — this prevents replay attacks where an attacker captures an authenticator and replays it later.</p>
<p>This is why clock skew over 5 minutes breaks Kerberos authentication entirely. If your machine&#8217;s clock drifts 6 minutes from the KDC, every authenticator you generate is rejected as too old or too far in the future. No tickets. No AD logins. No SSSD authentication.</p>
<pre><code class="" data-line=""># Check time sync status
timedatectl status
chronyc tracking        # if using chrony
ntpq -p                 # if using ntpd

# If clock is off: force a sync
chronyc makestep        # immediate step correction (chrony)
</code></pre>
<hr />
<h2 id="hands-on-kinit-klist-kdestroy">Hands-On: kinit, klist, kdestroy</h2>
<pre><code class="" data-line=""># Get a TGT (will prompt for password)
kinit vamshi@CORP.COM

# Show current tickets
klist
# Credentials cache: FILE:/tmp/krb5cc_1001
# Principal: vamshi@CORP.COM
#
# Valid starting     Expires            Service principal
# 04/27/26 01:00:00  04/27/26 11:00:00  krbtgt/CORP.COM@CORP.COM
#   renew until 05/04/26 01:00:00

# Show encryption types used (the -e flag)
klist -e
# 04/27/26 01:00:00  04/27/26 11:00:00  krbtgt/CORP.COM@CORP.COM
#         Etype: aes256-cts-hmac-sha1-96, aes256-cts-hmac-sha1-96

# Get a service ticket for a specific service
kvno host/server.corp.com@CORP.COM
# host/server.corp.com@CORP.COM: kvno = 3

# Show all tickets including service tickets
klist -f
# Flags: F=forwardable, f=forwarded, P=proxiable, p=proxy, D=postdated,
#        d=postdated, R=renewable, I=initial, i=invalid, H=hardware auth

# Destroy all tickets
kdestroy
</code></pre>
<p>The <code class="" data-line="">Valid starting</code> and <code class="" data-line="">Expires</code> fields are the ticket lifetime. After expiry, you need to re-authenticate (or renew the ticket if it&#8217;s within the <code class="" data-line="">renew until</code> window). The <code class="" data-line="">renew until</code> date is when even renewal stops working.</p>
<hr />
<h2 id="etckrb5conf">/etc/krb5.conf</h2>
<pre><code class="" data-line="">[libdefaults]
    default_realm = CORP.COM
    dns_lookup_realm = false
    dns_lookup_kdc = true         # find KDCs via DNS SRV records
    ticket_lifetime = 10h
    renew_lifetime = 7d
    forwardable = true            # tickets can be forwarded to remote hosts (needed for SSH forwarding)
    rdns = false

[realms]
    CORP.COM = {
        kdc = dc01.corp.com
        kdc = dc02.corp.com       # failover KDC
        admin_server = dc01.corp.com
    }

[domain_realm]
    .corp.com = CORP.COM
    corp.com = CORP.COM
</code></pre>
<p>With <code class="" data-line="">dns_lookup_kdc = true</code>, Kerberos finds KDCs by querying DNS SRV records (<code class="" data-line="">_kerberos._tcp.corp.com</code>). AD sets these up automatically. On MIT Kerberos, you add them manually. DNS-based discovery is the recommended approach for AD environments — it picks up new DCs automatically.</p>
<hr />
<h2 id="kerberos-ldap-why-enterprises-run-both">Kerberos + LDAP: Why Enterprises Run Both</h2>
<p>LDAP and Kerberos solve different problems and are almost always deployed together:</p>
<pre><code class="" data-line="">LDAP answers:  &quot;Who is vamshi? What groups is he in? What&#039;s his home directory?&quot;
Kerberos answers: &quot;Is this really vamshi? Prove it without sending a password.&quot;
</code></pre>
<p>Active Directory is exactly this combination — the directory is LDAP-based, the authentication is Kerberos. When a Linux machine joins an AD domain via <code class="" data-line="">realm join</code> or <code class="" data-line="">adcli</code>, it gets:<br />
&#8211; LDAP access to the AD directory (for NSS: user and group lookups)<br />
&#8211; A Kerberos principal registered in AD (for PAM: ticket-based authentication)<br />
&#8211; A machine account (the machine&#8217;s identity in the directory)</p>
<p>When you SSH into an AD-joined Linux machine:<br />
1. SSSD issues a Kerberos AS-REQ for the user&#8217;s TGT<br />
2. SSSD uses the TGT to get a service ticket for the Linux machine&#8217;s PAM service<br />
3. Authentication is verified via the service ticket — no LDAP Bind with a password<br />
4. SSSD does an LDAP Search to get POSIX attributes (UID, GID, home dir)</p>
<p>Password-based LDAP Bind is the fallback when Kerberos isn&#8217;t available. Kerberos is the default on AD-joined systems — and it&#8217;s more secure because the password never leaves the client.</p>
<hr />
<h2 id="common-misconceptions"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/26a0.png" alt="⚠" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Common Misconceptions</h2>
<p><strong>&#8220;Kerberos sends your password to the KDC.&#8221;</strong> It doesn&#8217;t. The client derives a key from the password locally and uses that key to encrypt a timestamp (the pre-authentication data). The KDC verifies the timestamp using the stored key. The raw password never travels.</p>
<p><strong>&#8220;Kerberos is an authorization protocol.&#8221;</strong> Kerberos authenticates — it proves who you are. Authorization (what you can do) is a separate decision, usually handled by ACLs on the service or directory group membership.</p>
<p><strong>&#8220;Once you have a TGT, you&#8217;re authenticated to everything.&#8221;</strong> A TGT only proves your identity to the KDC. Each service requires a separate service ticket. The TGT is what lets you get those service tickets without re-entering your password.</p>
<p><strong>&#8220;Kerberos requires AD.&#8221;</strong> MIT Kerberos 5 is a standalone implementation. FreeIPA (EP08) runs MIT Kerberos. Heimdal is another implementation. AD uses a Microsoft-extended version of Kerberos 5, but the core protocol is the same RFC.</p>
<hr />
<h2 id="framework-alignment">Framework Alignment</h2>
<table>
<thead>
<tr>
<th>Domain</th>
<th>Relevance</th>
</tr>
</thead>
<tbody>
<tr>
<td>CISSP Domain 5: Identity and Access Management</td>
<td>Kerberos is the de facto enterprise authentication protocol — SSO, delegation, and service account authentication all depend on it</td>
</tr>
<tr>
<td>CISSP Domain 4: Communications and Network Security</td>
<td>Kerberos prevents credential sniffing and replay attacks — two of the core network authentication threat categories</td>
</tr>
<tr>
<td>CISSP Domain 3: Security Architecture and Engineering</td>
<td>The KDC is a critical single point of trust — its availability, key management, and account (<code class="" data-line="">krbtgt</code>) rotation are architectural security decisions</td>
</tr>
</tbody>
</table>
<hr />
<h2 id="key-takeaways">Key Takeaways</h2>
<ul>
<li>Kerberos is a ticket-based protocol — the password is used once to get a TGT; from then on, tickets prove identity without the password</li>
<li>The three-step flow: get a TGT from the AS, exchange it for a service ticket at the TGS, present the service ticket to the target service</li>
<li>Clock skew over 5 minutes breaks Kerberos — time synchronization is a hard dependency</li>
<li>LDAP stores identity; Kerberos authenticates it — Active Directory is exactly this combination, and so is FreeIPA</li>
<li><code class="" data-line="">klist -e</code> shows the encryption types in use — <code class="" data-line="">aes256-cts-hmac-sha1-96</code> is what you want to see; <code class="" data-line="">arcfour-hmac</code> (RC4) is legacy and should be disabled</li>
</ul>
<hr />
<h2 id="whats-next">What&#8217;s Next</h2>
<p>EP05 covered Kerberos as a protocol. EP06 goes hands-on: building a real LDAP directory with OpenLDAP, configuring replication, and understanding how the server-side components — <code class="" data-line="">slapd</code>, the MDB backend, SyncRepl — fit together.</p>
<p><em>Next: <a href="/openldap-setup-replication/">OpenLDAP Setup and Replication: Running Your Own Directory</a></em></p>
<p>Get EP06 in your inbox when it publishes → <a href="https://linuxcent.com/subscribe">linuxcent.com/subscribe</a></p>
<p><a class="a2a_button_mastodon" href="https://www.addtoany.com/add_to/mastodon?linkurl=https%3A%2F%2Flinuxcent.com%2Fhow-kerberos-works%2F&amp;linkname=How%20Kerberos%20Works%3A%20Tickets%2C%20KDC%2C%20and%20Why%20Enterprises%20Use%20It%20With%20LDAP" title="Mastodon" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_email" href="https://www.addtoany.com/add_to/email?linkurl=https%3A%2F%2Flinuxcent.com%2Fhow-kerberos-works%2F&amp;linkname=How%20Kerberos%20Works%3A%20Tickets%2C%20KDC%2C%20and%20Why%20Enterprises%20Use%20It%20With%20LDAP" title="Email" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_whatsapp" href="https://www.addtoany.com/add_to/whatsapp?linkurl=https%3A%2F%2Flinuxcent.com%2Fhow-kerberos-works%2F&amp;linkname=How%20Kerberos%20Works%3A%20Tickets%2C%20KDC%2C%20and%20Why%20Enterprises%20Use%20It%20With%20LDAP" title="WhatsApp" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Flinuxcent.com%2Fhow-kerberos-works%2F&amp;linkname=How%20Kerberos%20Works%3A%20Tickets%2C%20KDC%2C%20and%20Why%20Enterprises%20Use%20It%20With%20LDAP" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_x" href="https://www.addtoany.com/add_to/x?linkurl=https%3A%2F%2Flinuxcent.com%2Fhow-kerberos-works%2F&amp;linkname=How%20Kerberos%20Works%3A%20Tickets%2C%20KDC%2C%20and%20Why%20Enterprises%20Use%20It%20With%20LDAP" title="X" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Flinuxcent.com%2Fhow-kerberos-works%2F&amp;linkname=How%20Kerberos%20Works%3A%20Tickets%2C%20KDC%2C%20and%20Why%20Enterprises%20Use%20It%20With%20LDAP" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_copy_link" href="https://www.addtoany.com/add_to/copy_link?linkurl=https%3A%2F%2Flinuxcent.com%2Fhow-kerberos-works%2F&amp;linkname=How%20Kerberos%20Works%3A%20Tickets%2C%20KDC%2C%20and%20Why%20Enterprises%20Use%20It%20With%20LDAP" title="Copy Link" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Flinuxcent.com%2Fhow-kerberos-works%2F&#038;title=How%20Kerberos%20Works%3A%20Tickets%2C%20KDC%2C%20and%20Why%20Enterprises%20Use%20It%20With%20LDAP" data-a2a-url="https://linuxcent.com/how-kerberos-works/" data-a2a-title="How Kerberos Works: Tickets, KDC, and Why Enterprises Use It With LDAP"></a></p><p>The post <a href="https://linuxcent.com/how-kerberos-works/">How Kerberos Works: Tickets, KDC, and Why Enterprises Use It With LDAP</a> appeared first on <a href="https://linuxcent.com">Linuxcent</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://linuxcent.com/how-kerberos-works/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1784</post-id>	</item>
		<item>
		<title>SSSD: The Caching Daemon That Powers Every Enterprise Linux Login</title>
		<link>https://linuxcent.com/sssd-linux-authentication/</link>
					<comments>https://linuxcent.com/sssd-linux-authentication/#respond</comments>
		
		<dc:creator><![CDATA[Vamshi Krishna Santhapuri]]></dc:creator>
		<pubDate>Mon, 27 Apr 2026 05:00:00 +0000</pubDate>
				<category><![CDATA[Identity & Authentication]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Authentication]]></category>
		<category><![CDATA[LDAP]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux-security]]></category>
		<category><![CDATA[PAM]]></category>
		<category><![CDATA[SSSD]]></category>
		<guid isPermaLink="false">https://linuxcent.com/?p=1781</guid>

					<description><![CDATA[<p><span class="span-reading-time rt-reading-time" style="display: block;"><span class="rt-label rt-prefix">Reading Time: </span> <span class="rt-time"> 7</span> <span class="rt-label rt-postfix">minutes</span></span>SSSD is the daemon behind every enterprise Linux login — offline caching, PAM integration, multi-domain support. Here's how it works and how to debug it.</p>
<p>The post <a href="https://linuxcent.com/sssd-linux-authentication/">SSSD: The Caching Daemon That Powers Every Enterprise Linux Login</a> appeared first on <a href="https://linuxcent.com">Linuxcent</a>.</p>
]]></description>
										<content:encoded><![CDATA[<span class="span-reading-time rt-reading-time" style="display: block;"><span class="rt-label rt-prefix">Reading Time: </span> <span class="rt-time"> 7</span> <span class="rt-label rt-postfix">minutes</span></span><style>
pre{position:relative;background:#1e1e1e;color:#d4d4d4;
    padding:16px 16px 16px 20px;border-radius:6px;overflow-x:auto;
    font-family:'JetBrains Mono','Fira Code','Cascadia Code',Consolas,'Courier New',monospace;
    font-size:.88em;line-height:1.6;border-left:4px solid #555}
code{background:#f4f4f4;padding:2px 5px;border-radius:3px;font-size:.9em}
pre code{background:transparent;padding:0;color:inherit}
pre[data-lang="bash"],pre[data-lang="sh"],
pre[data-lang="shell"],pre[data-lang="zsh"]{border-left-color:#4ec9b0}
pre[data-lang="yaml"],pre[data-lang="json"],
pre[data-lang="toml"],pre[data-lang="xml"]{border-left-color:#569cd6}
pre[data-lang="python"],pre[data-lang="go"],pre[data-lang="rust"],
pre[data-lang="java"],pre[data-lang="c"],pre[data-lang="cpp"]{border-left-color:#c586c0}
pre[data-lang="text"],pre[data-lang="output"],
pre[data-lang="console"]{border-left-color:#888}
.lc-copy-btn{position:absolute;top:8px;right:8px;background:#2d2d2d;color:#ccc;
    border:1px solid #444;border-radius:4px;padding:3px 9px;font-size:.75em;
    font-family:system-ui,sans-serif;cursor:pointer;opacity:0;
    transition:opacity .15s,background .15s;line-height:1.6}
pre:hover .lc-copy-btn{opacity:1}
.lc-copy-btn:hover{background:#3a3a3a;color:#fff}
.lc-copy-btn.copied{color:#4ec9b0;border-color:#4ec9b0}
.lc-lang-badge{position:absolute;top:8px;left:20px;font-family:system-ui,sans-serif;
    font-size:.7em;color:#666;text-transform:uppercase;letter-spacing:.04em;
    line-height:1;pointer-events:none;opacity:0;transition:opacity .15s}
pre:hover .lc-lang-badge{opacity:1}
table{border-collapse:collapse;width:100%;margin:16px 0}
th,td{border:1px solid #ddd;padding:10px 14px;text-align:left}
th{background:#f0f0f0;font-weight:600}
tr:nth-child(even){background:#fafafa}
</style>
<p><script>
(function(){
  if(window.__lcCodeEnhanced)return;
  window.__lcCodeEnhanced=true;
  function enhance(){
    document.querySelectorAll('pre').forEach(function(pre){
      var code=pre.querySelector('code');
      var lang='';
      if(code){var m=(code.className||'').match(/language-(\S+)/);if(m)lang=m[1].toLowerCase();}
      if(lang)pre.setAttribute('data-lang',lang);
      if(lang){var badge=document.createElement('span');badge.className='lc-lang-badge';badge.textContent=lang;pre.insertBefore(badge,pre.firstChild);}
      var btn=document.createElement('button');
      btn.className='lc-copy-btn';btn.textContent='Copy';btn.setAttribute('aria-label','Copy code to clipboard');
      pre.appendChild(btn);
      btn.addEventListener('click',function(){
        var text=code?code.innerText:pre.innerText;
        if(navigator.clipboard&&window.isSecureContext){
          navigator.clipboard.writeText(text).then(function(){ok(btn);}).catch(function(){fb(text,btn);});
        }else{fb(text,btn);}
      });
    });
  }
  function ok(btn){btn.textContent='Copied!';btn.classList.add('copied');setTimeout(function(){btn.textContent='Copy';btn.classList.remove('copied');},2000);}
  function fb(text,btn){
    try{var ta=document.createElement('textarea');ta.value=text;ta.style.cssText='position:fixed;left:-9999px;top:-9999px;opacity:0';document.body.appendChild(ta);ta.select();document.execCommand('copy');document.body.removeChild(ta);ok(btn);}
    catch(e){btn.textContent='✗ Failed';setTimeout(function(){btn.textContent='Copy';},2000);}
  }
  if(document.readyState==='loading'){document.addEventListener('DOMContentLoaded',enhance);}else{enhance();}
})();
</script></p>
<p><em>The Identity Stack, Episode 4</em><br />
<a href="/what-is-ldap/">EP01: What Is LDAP</a> → <a href="/ldap-internals-directory-structure/">EP02: LDAP Internals</a> → <a href="/ldap-authentication-linux-pam-nss/">EP03: LDAP Auth on Linux</a> → <strong>EP04</strong> → <a href="/how-kerberos-works-tickets-kdc/">EP05: Kerberos</a> → &#8230;</p>
<hr />
<h2 id="tldr">TL;DR</h2>
<ul>
<li>SSSD (System Security Services Daemon) is the caching and brokering layer between Linux and directory services — it handles LDAP, Kerberos, and AD so PAM and NSS don&#8217;t have to</li>
<li>Architecture: three tiers — responders (answer PAM/NSS queries), providers (talk to AD/LDAP/Kerberos), and a shared cache (LDB database on disk)</li>
<li>Credential caching means offline logins work — a user who authenticated yesterday can log in today even if the domain controller is unreachable</li>
<li>Key config: <code class="" data-line="">sssd.conf</code> — the <code class="" data-line="">[domain]</code> section is where almost all tuning happens</li>
<li>Debugging toolkit: <code class="" data-line="">sssctl</code>, <code class="" data-line="">sss_cache</code>, <code class="" data-line="">id</code>, <code class="" data-line="">getent</code>, <code class="" data-line="">journalctl -u sssd</code></li>
<li>The most common failure modes are: SSSD not running, stale cache, misconfigured <code class="" data-line="">ldap_search_base</code>, and clock skew breaking Kerberos</li>
</ul>
<hr />
<h2 id="the-big-picture-sssd-as-the-identity-broker">The Big Picture: SSSD as the Identity Broker</h2>
<pre><code class="" data-line="">PAM (pam_sss)         NSS (sss module)
      │                      │
      └──────────┬───────────┘
                 ▼
          SSSD Responders
          ┌────────────────────────────────────┐
          │  PAM responder   NSS responder      │
          │  (auth, account, (passwd, group,    │
          │   session)        shadow lookups)   │
          └────────────┬───────────────────────┘
                       │  shared cache (LDB)
                       ▼
          SSSD Providers
          ┌────────────────────────────────────┐
          │  identity provider  auth provider   │
          │  (user/group attrs) (credentials)   │
          └────────────┬───────────────────────┘
                       │
          ┌────────────┼────────────┐
          ▼            ▼            ▼
       LDAP          Kerberos    Local files
    (AD / OpenLDAP)  (KDC / AD)
</code></pre>
<p>EP03 showed that SSSD sits between PAM and LDAP. This episode goes inside it — the architecture, the config, and how to tell exactly what it&#8217;s doing on any given login attempt.</p>
<hr />
<h2 id="why-sssd-exists">Why SSSD Exists</h2>
<p>The problem before SSSD: <code class="" data-line="">nss_ldap</code> and <code class="" data-line="">pam_ldap</code> made direct LDAP connections for every query. No caching, no connection pooling, no failover, no offline support. On a system that makes dozens of <code class="" data-line="">getpwuid()</code> calls per second (every <code class="" data-line="">ls -l</code>, every process spawn), this meant dozens of LDAP roundtrips per second hitting the domain controller.</p>
<p>SSSD solved this with a single daemon that:<br />
&#8211; Maintains a persistent connection pool to the directory<br />
&#8211; Caches identity and credential data in an LDB (LDAP-like) database on disk<br />
&#8211; Handles failover across multiple directory servers<br />
&#8211; Satisfies PAM and NSS queries from cache when the directory is unreachable</p>
<p>The credential cache is the key insight. When you authenticate successfully, SSSD stores a hash of your credentials locally. If the domain controller is unreachable on your next login — network outage, laptop offline, VPN not connected — SSSD can verify your credentials against the local cache. You log in. You never knew the DC was down.</p>
<hr />
<h2 id="sssd-architecture">SSSD Architecture</h2>
<p>SSSD is a set of cooperating processes sharing a cache:</p>
<p><strong>Monitor</strong> — the parent process. Starts and restarts all other SSSD processes. If a responder or provider crashes, the monitor restarts it.</p>
<p><strong>Responders</strong> — answer queries from PAM and NSS. Each responder handles a specific interface:<br />
&#8211; <code class="" data-line="">sssd_nss</code> — answers <code class="" data-line="">getpwnam()</code>, <code class="" data-line="">getpwuid()</code>, <code class="" data-line="">getgrnam()</code>, <code class="" data-line="">initgroups()</code> calls<br />
&#8211; <code class="" data-line="">sssd_pam</code> — handles PAM authentication, account checks, and session management<br />
&#8211; <code class="" data-line="">sssd_autofs</code>, <code class="" data-line="">sssd_ssh</code>, <code class="" data-line="">sssd_sudo</code> — optional responders for specific services</p>
<p><strong>Providers</strong> — the backend processes that talk to the actual directory:<br />
&#8211; Each domain gets its own provider process (<code class="" data-line="">sssd_be[domain_name]</code>)<br />
&#8211; The provider connects to LDAP/Kerberos/AD, fetches data, and writes it to the shared cache<br />
&#8211; If the provider crashes or loses connectivity, responders fall back to serving from cache</p>
<p><strong>Cache</strong> — LDB files in <code class="" data-line="">/var/lib/sss/db/</code>. One database per configured domain, plus a cache for negative results (lookups that returned &#8220;not found&#8221;). The cache is an LDAP-like directory stored on disk — SSSD uses the same hierarchical structure for local storage as the remote directory uses.</p>
<pre><code class="" data-line=""># See the cache files
ls -la /var/lib/sss/db/
# cache_corp.com.ldb         ← user/group data for domain corp.com
# ccache_corp.com            ← Kerberos credential cache
# timestamps_corp.com.ldb   ← when entries were last refreshed
</code></pre>
<hr />
<h2 id="sssdconf-the-config-that-matters">sssd.conf: The Config That Matters</h2>
<p><code class="" data-line="">/etc/sssd/sssd.conf</code> has a <code class="" data-line="">[sssd]</code> section (global) and one <code class="" data-line="">[domain/name]</code> section per directory. The domain section is where almost all tuning happens.</p>
<pre><code class="" data-line="">[sssd]
services = nss, pam, sudo
domains = corp.com
config_file_version = 2

[domain/corp.com]
# What type of directory this is
id_provider = ad               # or: ldap, ipa, files
auth_provider = ad             # or: ldap, krb5, none
access_provider = ad           # controls who can log in

# The AD/LDAP server (can be a list for failover)
ad_domain = corp.com
ad_server = dc01.corp.com, dc02.corp.com

# Where to look for users and groups
ldap_search_base = dc=corp,dc=com

# Cache behavior
cache_credentials = true       # enable offline login
entry_cache_timeout = 5400     # how long before re-querying (seconds)
offline_credentials_expiration = 1  # days cached credentials stay valid offline

# What uid/gid range belongs to this domain (prevents UID conflicts)
ldap_id_mapping = true         # auto-map AD SIDs to UIDs (no uidNumber needed)
# OR for classical POSIX LDAP:
# ldap_id_mapping = false      # use uidNumber/gidNumber from directory

# Restrict logins to specific AD groups
# access_provider = simple
# simple_allow_groups = linux-admins, sre-team

# Home directory and shell defaults
override_homedir = /home/%u
default_shell = /bin/bash
fallback_homedir = /home/%u

# Enumerate all users (expensive on large dirs — disable unless needed)
enumerate = false
</code></pre>
<p>The two most commonly wrong settings:</p>
<p><strong><code class="" data-line="">ldap_search_base</code></strong> — if this doesn&#8217;t include the OU where your users live, SSSD won&#8217;t find them. On AD, the default searches the entire domain, which is usually correct. On OpenLDAP, you may need <code class="" data-line="">ou=people,dc=corp,dc=com</code>.</p>
<p><strong><code class="" data-line="">ldap_id_mapping</code></strong> — on AD, users typically don&#8217;t have <code class="" data-line="">uidNumber</code> attributes. Setting <code class="" data-line="">ldap_id_mapping = true</code> tells SSSD to derive a UID from the user&#8217;s SID algorithmically. This produces consistent UIDs across machines. Setting it to <code class="" data-line="">false</code> requires actual <code class="" data-line="">uidNumber</code> attributes in the directory.</p>
<hr />
<h2 id="credential-caching-and-offline-logins">Credential Caching and Offline Logins</h2>
<p>The cache is what separates SSSD from a simple proxy. When <code class="" data-line="">cache_credentials = true</code>:</p>
<ol>
<li>On successful authentication, SSSD stores a hash of the credential in the LDB cache</li>
<li>On the next authentication attempt, SSSD first tries the domain controller</li>
<li>If the DC is unreachable, SSSD falls back to the local credential hash</li>
<li>If the hash matches, login succeeds — even with no network</li>
</ol>
<p>The credential hash is not the cleartext password — it&#8217;s a salted hash stored in <code class="" data-line="">/var/lib/sss/db/cache_corp.com.ldb</code>. The security model is the same as <code class="" data-line="">/etc/shadow</code>: someone with root access to the machine can access the hashes.</p>
<p><code class="" data-line="">offline_credentials_expiration</code> controls how long cached credentials stay valid when the DC is unreachable. <code class="" data-line="">0</code> means forever (not recommended for high-security environments). <code class="" data-line="">1</code> means one day — after 24 hours offline, even cached credentials expire and the user must authenticate online.</p>
<hr />
<h2 id="the-debugging-toolkit">The Debugging Toolkit</h2>
<pre><code class="" data-line=""># 1. Is SSSD running?
systemctl status sssd
pgrep -a sssd    # shows all SSSD processes (monitor + responders + providers)

# 2. Domain connectivity status
sssctl domain-status corp.com
# Domain: corp.com
# Active servers:
#   LDAP: dc01.corp.com
#   KDC: dc01.corp.com
# Discovered servers:
#   LDAP: dc01.corp.com, dc02.corp.com

# 3. Can SSSD find a specific user?
sssctl user-checks vamshi
# user: vamshi
# user name: vamshi@corp.com
# POSIX attributes: UID=1001, GID=1001, ...
# Authentication: success (uses actual PAM auth stack)

# 4. What does NSS see?
getent passwd vamshi          # full passwd entry
id vamshi                     # uid, gid, groups

# 5. Flush stale cache entries
sss_cache -u vamshi           # invalidate one user
sss_cache -G engineers        # invalidate one group
sss_cache -E                  # invalidate everything (nuclear option)

# 6. Live logs
journalctl -u sssd -f         # tail all SSSD logs
# Then attempt login in another terminal — watch the auth flow in real time

# 7. Increase log verbosity temporarily
sssctl config-check            # validate sssd.conf syntax
# Edit sssd.conf: add debug_level = 6 under [domain/corp.com]
systemctl restart sssd
journalctl -u sssd -f          # now shows LDAP queries, cache hits/misses
</code></pre>
<p>The single most useful command is <code class="" data-line="">sssctl user-checks &lt;username&gt;</code>. It runs the full NSS + PAM auth stack internally and prints what SSSD would do on a real login — without creating a session or touching the running system.</p>
<hr />
<h2 id="breaking-sssd-and-what-each-failure-looks-like">Breaking SSSD (and What Each Failure Looks Like)</h2>
<p><strong>SSSD not running:</strong></p>
<pre><code class="" data-line="">ssh vamshi@server
# Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password)
# getent passwd vamshi → (empty)
# Fix: systemctl start sssd
</code></pre>
<p><strong>Stale cache after AD password change:</strong></p>
<pre><code class="" data-line=""># User changed password in AD but SSSD still has old credential hash
ssh vamshi@server  # password accepted (wrong!) — cache hit with old hash
# Fix: sss_cache -u vamshi, then attempt login again
</code></pre>
<p><strong>Clock skew &gt; 5 minutes (breaks Kerberos):</strong></p>
<pre><code class="" data-line="">journalctl -u sssd | grep -i &quot;clock skew\|KDC\|kinit&quot;
# sssd_be[corp.com]: Kerberos authentication failed: Clock skew too great
# Fix: systemctl restart chronyd (or ntpd), verify time sync
</code></pre>
<p><strong><code class="" data-line="">ldap_search_base</code> wrong:</strong></p>
<pre><code class="" data-line="">getent passwd vamshi  # empty, but user exists in AD
sssctl user-checks vamshi  # &quot;User not found&quot;
# Check: ldap_search_base must include the OU containing users
# Test: ldapsearch -x -H ldap://dc -b &quot;ou=engineers,dc=corp,dc=com&quot; &quot;(uid=vamshi)&quot;
</code></pre>
<hr />
<h2 id="common-misconceptions"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/26a0.png" alt="⚠" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Common Misconceptions</h2>
<p><strong>&#8220;Restarting SSSD logs everyone out.&#8221;</strong> Restarting SSSD doesn&#8217;t affect existing authenticated sessions. Active shell sessions, running processes — all unaffected. Only new authentication attempts are disrupted during the restart window, which takes a few seconds.</p>
<p><strong>&#8220;sss_cache -E fixes everything.&#8221;</strong> Flushing the entire cache forces SSSD to re-fetch all entries from the domain controller on the next lookup. On a system with many users or enumeration enabled, this can cause a brief spike in LDAP traffic and slow lookups. Use targeted flushes (<code class="" data-line="">-u username</code>, <code class="" data-line="">-G group</code>) when possible.</p>
<p><strong>&#8220;debug_level should always be high.&#8221;</strong> SSSD at <code class="" data-line="">debug_level = 9</code> logs every LDAP packet. On a production system with active logins, this generates gigabytes of logs quickly. Set it temporarily for debugging, then remove it and restart.</p>
<hr />
<h2 id="framework-alignment">Framework Alignment</h2>
<table>
<thead>
<tr>
<th>Domain</th>
<th>Relevance</th>
</tr>
</thead>
<tbody>
<tr>
<td>CISSP Domain 5: Identity and Access Management</td>
<td>SSSD is the runtime implementation of enterprise identity integration on Linux — understanding its caching model, failover behavior, and credential storage is foundational to IAM operations</td>
</tr>
<tr>
<td>CISSP Domain 3: Security Architecture and Engineering</td>
<td>The credential cache design (<code class="" data-line="">/var/lib/sss/db/</code>) creates a local credential store with specific security properties — architects need to understand the offline login trade-off</td>
</tr>
<tr>
<td>CISSP Domain 7: Security Operations</td>
<td>SSSD is a critical security service — monitoring it, understanding its failure modes, and knowing how to recover it quickly are operational security skills</td>
</tr>
</tbody>
</table>
<hr />
<h2 id="key-takeaways">Key Takeaways</h2>
<ul>
<li>SSSD is a three-tier system: responders (serve PAM/NSS), providers (talk to AD/LDAP), and a shared LDB cache — each tier is independently restartable</li>
<li>Credential caching enables offline logins — the security trade-off is a local hash store in <code class="" data-line="">/var/lib/sss/db/</code></li>
<li><code class="" data-line="">sssctl user-checks</code> is the first tool to reach for when a login fails — it simulates the full auth flow and shows exactly where it breaks</li>
<li><code class="" data-line="">ldap_id_mapping = true</code> is the right choice for AD environments without POSIX attributes; <code class="" data-line="">false</code> requires actual <code class="" data-line="">uidNumber</code>/<code class="" data-line="">gidNumber</code> in the directory</li>
<li>Clock skew over 5 minutes silently breaks Kerberos authentication — time sync is a hard dependency</li>
</ul>
<hr />
<h2 id="whats-next">What&#8217;s Next</h2>
<p>EP04 showed SSSD&#8217;s role as the caching and brokering layer. What it referenced repeatedly — &#8220;Kerberos ticket&#8221;, &#8220;KDC&#8221;, &#8220;GSSAPI&#8221; — is the authentication protocol that sits underneath AD-joined Linux logins. SSSD uses Kerberos to authenticate. LDAP carries the identity data. EP05 explains how Kerberos works.</p>
<p><em>Next: <a href="/how-kerberos-works-tickets-kdc/">How Kerberos Works: Tickets, KDC, and Why Enterprises Use It With LDAP</a></em></p>
<p>Get EP05 in your inbox when it publishes → <a href="https://linuxcent.com/subscribe">linuxcent.com/subscribe</a></p>
<p><a class="a2a_button_mastodon" href="https://www.addtoany.com/add_to/mastodon?linkurl=https%3A%2F%2Flinuxcent.com%2Fsssd-linux-authentication%2F&amp;linkname=SSSD%3A%20The%20Caching%20Daemon%20That%20Powers%20Every%20Enterprise%20Linux%20Login" title="Mastodon" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_email" href="https://www.addtoany.com/add_to/email?linkurl=https%3A%2F%2Flinuxcent.com%2Fsssd-linux-authentication%2F&amp;linkname=SSSD%3A%20The%20Caching%20Daemon%20That%20Powers%20Every%20Enterprise%20Linux%20Login" title="Email" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_whatsapp" href="https://www.addtoany.com/add_to/whatsapp?linkurl=https%3A%2F%2Flinuxcent.com%2Fsssd-linux-authentication%2F&amp;linkname=SSSD%3A%20The%20Caching%20Daemon%20That%20Powers%20Every%20Enterprise%20Linux%20Login" title="WhatsApp" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Flinuxcent.com%2Fsssd-linux-authentication%2F&amp;linkname=SSSD%3A%20The%20Caching%20Daemon%20That%20Powers%20Every%20Enterprise%20Linux%20Login" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_x" href="https://www.addtoany.com/add_to/x?linkurl=https%3A%2F%2Flinuxcent.com%2Fsssd-linux-authentication%2F&amp;linkname=SSSD%3A%20The%20Caching%20Daemon%20That%20Powers%20Every%20Enterprise%20Linux%20Login" title="X" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Flinuxcent.com%2Fsssd-linux-authentication%2F&amp;linkname=SSSD%3A%20The%20Caching%20Daemon%20That%20Powers%20Every%20Enterprise%20Linux%20Login" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_copy_link" href="https://www.addtoany.com/add_to/copy_link?linkurl=https%3A%2F%2Flinuxcent.com%2Fsssd-linux-authentication%2F&amp;linkname=SSSD%3A%20The%20Caching%20Daemon%20That%20Powers%20Every%20Enterprise%20Linux%20Login" title="Copy Link" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Flinuxcent.com%2Fsssd-linux-authentication%2F&#038;title=SSSD%3A%20The%20Caching%20Daemon%20That%20Powers%20Every%20Enterprise%20Linux%20Login" data-a2a-url="https://linuxcent.com/sssd-linux-authentication/" data-a2a-title="SSSD: The Caching Daemon That Powers Every Enterprise Linux Login"></a></p><p>The post <a href="https://linuxcent.com/sssd-linux-authentication/">SSSD: The Caching Daemon That Powers Every Enterprise Linux Login</a> appeared first on <a href="https://linuxcent.com">Linuxcent</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://linuxcent.com/sssd-linux-authentication/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1781</post-id>	</item>
		<item>
		<title>How LDAP Authentication Works on Linux: PAM, NSS, and the Login Stack</title>
		<link>https://linuxcent.com/ldap-authentication-linux-pam-nss/</link>
					<comments>https://linuxcent.com/ldap-authentication-linux-pam-nss/#respond</comments>
		
		<dc:creator><![CDATA[Vamshi Krishna Santhapuri]]></dc:creator>
		<pubDate>Sun, 26 Apr 2026 19:46:19 +0000</pubDate>
				<category><![CDATA[Identity & Authentication]]></category>
		<category><![CDATA[Authentication]]></category>
		<category><![CDATA[LDAP]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux-security]]></category>
		<category><![CDATA[NSS]]></category>
		<category><![CDATA[PAM]]></category>
		<category><![CDATA[SSSD]]></category>
		<guid isPermaLink="false">https://linuxcent.com/ldap-authentication-linux-pam-nss/</guid>

					<description><![CDATA[<p><span class="span-reading-time rt-reading-time" style="display: block;"><span class="rt-label rt-prefix">Reading Time: </span> <span class="rt-time"> 8</span> <span class="rt-label rt-postfix">minutes</span></span>How LDAP authentication works on Linux: trace an SSH login through PAM, nsswitch.conf, and SSSD to understand exactly what happens before the shell opens.</p>
<p>The post <a href="https://linuxcent.com/ldap-authentication-linux-pam-nss/">How LDAP Authentication Works on Linux: PAM, NSS, and the Login Stack</a> appeared first on <a href="https://linuxcent.com">Linuxcent</a>.</p>
]]></description>
										<content:encoded><![CDATA[<span class="span-reading-time rt-reading-time" style="display: block;"><span class="rt-label rt-prefix">Reading Time: </span> <span class="rt-time"> 8</span> <span class="rt-label rt-postfix">minutes</span></span><style>
pre{position:relative;background:#1e1e1e;color:#d4d4d4;
    padding:16px 16px 16px 20px;border-radius:6px;overflow-x:auto;
    font-family:'JetBrains Mono','Fira Code','Cascadia Code',Consolas,'Courier New',monospace;
    font-size:.88em;line-height:1.6;border-left:4px solid #555}
code{background:#f4f4f4;padding:2px 5px;border-radius:3px;font-size:.9em}
pre code{background:transparent;padding:0;color:inherit}
pre[data-lang="bash"],pre[data-lang="sh"],
pre[data-lang="shell"],pre[data-lang="zsh"]{border-left-color:#4ec9b0}
pre[data-lang="yaml"],pre[data-lang="json"],
pre[data-lang="toml"],pre[data-lang="xml"]{border-left-color:#569cd6}
pre[data-lang="python"],pre[data-lang="go"],pre[data-lang="rust"],
pre[data-lang="java"],pre[data-lang="c"],pre[data-lang="cpp"]{border-left-color:#c586c0}
pre[data-lang="text"],pre[data-lang="output"],
pre[data-lang="console"]{border-left-color:#888}
.lc-copy-btn{position:absolute;top:8px;right:8px;background:#2d2d2d;color:#ccc;
    border:1px solid #444;border-radius:4px;padding:3px 9px;font-size:.75em;
    font-family:system-ui,sans-serif;cursor:pointer;opacity:0;
    transition:opacity .15s,background .15s;line-height:1.6}
pre:hover .lc-copy-btn{opacity:1}
.lc-copy-btn:hover{background:#3a3a3a;color:#fff}
.lc-copy-btn.copied{color:#4ec9b0;border-color:#4ec9b0}
.lc-lang-badge{position:absolute;top:8px;left:20px;font-family:system-ui,sans-serif;
    font-size:.7em;color:#666;text-transform:uppercase;letter-spacing:.04em;
    line-height:1;pointer-events:none;opacity:0;transition:opacity .15s}
pre:hover .lc-lang-badge{opacity:1}
table{border-collapse:collapse;width:100%;margin:16px 0}
th,td{border:1px solid #ddd;padding:10px 14px;text-align:left}
th{background:#f0f0f0;font-weight:600}
tr:nth-child(even){background:#fafafa}
</style>
<p><script>
(function(){
  if(window.__lcCodeEnhanced)return;
  window.__lcCodeEnhanced=true;
  function enhance(){
    document.querySelectorAll('pre').forEach(function(pre){
      var code=pre.querySelector('code');
      var lang='';
      if(code){var m=(code.className||'').match(/language-(\S+)/);if(m)lang=m[1].toLowerCase();}
      if(lang)pre.setAttribute('data-lang',lang);
      if(lang){var badge=document.createElement('span');badge.className='lc-lang-badge';badge.textContent=lang;pre.insertBefore(badge,pre.firstChild);}
      var btn=document.createElement('button');
      btn.className='lc-copy-btn';btn.textContent='Copy';btn.setAttribute('aria-label','Copy code to clipboard');
      pre.appendChild(btn);
      btn.addEventListener('click',function(){
        var text=code?code.innerText:pre.innerText;
        if(navigator.clipboard&&window.isSecureContext){
          navigator.clipboard.writeText(text).then(function(){ok(btn);}).catch(function(){fb(text,btn);});
        }else{fb(text,btn);}
      });
    });
  }
  function ok(btn){btn.textContent='Copied!';btn.classList.add('copied');setTimeout(function(){btn.textContent='Copy';btn.classList.remove('copied');},2000);}
  function fb(text,btn){
    try{var ta=document.createElement('textarea');ta.value=text;ta.style.cssText='position:fixed;left:-9999px;top:-9999px;opacity:0';document.body.appendChild(ta);ta.select();document.execCommand('copy');document.body.removeChild(ta);ok(btn);}
    catch(e){btn.textContent='✗ Failed';setTimeout(function(){btn.textContent='Copy';},2000);}
  }
  if(document.readyState==='loading'){document.addEventListener('DOMContentLoaded',enhance);}else{enhance();}
})();
</script></p>
<p><em>The Identity Stack, Episode 3</em><br />
<a href="/what-is-ldap/">EP01: What Is LDAP</a> → <a href="/ldap-internals-directory-structure/">EP02: LDAP Internals</a> → <strong>EP03</strong> → <a href="/sssd-linux-authentication/">EP04: SSSD</a> → &#8230;</p>
<hr />
<h2 id="tldr">TL;DR</h2>
<ul>
<li>LDAP is a directory protocol — it stores identity information and can verify a password via Bind, but authentication on Linux runs through PAM, not directly through LDAP</li>
<li>NSS (<code class="" data-line="">/etc/nsswitch.conf</code>) answers &#8220;who is this user?&#8221; — it resolves UIDs, group memberships, and home directories by querying LDAP (or the local files, or SSSD)</li>
<li>PAM (<code class="" data-line="">/etc/pam.d/</code>) answers &#8220;are they allowed in?&#8221; — it enforces authentication, account validity, session setup, and password policy</li>
<li><code class="" data-line="">pam_ldap</code> (the old way) opened a direct LDAP connection on every login — fragile, no caching, broken when the LDAP server was unreachable</li>
<li><code class="" data-line="">pam_sss</code> (the modern way) delegates to SSSD, which caches credentials and handles failover — SSSD is the layer between Linux and the directory</li>
<li>Tracing a single SSH login: <code class="" data-line="">sshd</code> → PAM → <code class="" data-line="">pam_sss</code> → SSSD → LDAP Bind + Search → session created</li>
</ul>
<hr />
<h2 id="the-big-picture-one-ssh-login-four-layers">The Big Picture: One SSH Login, Four Layers</h2>
<pre><code class="" data-line="">You type: ssh vamshi@server.corp.com

  sshd
    │
    ▼
  PAM  (/etc/pam.d/sshd)          ← &quot;Is this user allowed in?&quot;
    │
    ├── pam_sss    (auth)          ← sends credentials to SSSD
    ├── pam_sss    (account)       ← checks account not expired/locked
    ├── pam_sss    (session)       ← logs the session open/close
    └── pam_mkhomedir (session)    ← creates /home/vamshi if it doesn&#039;t exist
    │
    ▼
  SSSD  (/etc/sssd/sssd.conf)     ← &quot;Let me check the directory&quot;
    │
    ├── NSS responder              ← answers getent, id, getpwnam
    └── LDAP/Kerberos provider     ← talks to the actual directory
    │
    ▼
  LDAP Server (AD / OpenLDAP)
    │
    ├── Bind: uid=vamshi + password (or Kerberos ticket)
    └── Search: posixAccount attrs for uid=vamshi
    │
    ▼
  Linux session created
  UID=1001, GID=1001, HOME=/home/vamshi, SHELL=/bin/bash
</code></pre>
<p>EP02 showed what the directory contains and what travels on the wire. What it left open is how Linux uses that to grant a login — and why LDAP is not, by itself, an authentication protocol.</p>
<hr />
<h2 id="why-ldap-is-not-an-authentication-protocol">Why LDAP Is Not an Authentication Protocol</h2>
<p>This is the confusion that trips people most. LDAP can verify a password — the Bind operation does exactly that. But authentication on Linux means something broader: checking credentials, checking account validity, enforcing password policy, setting up a session, creating a home directory. LDAP handles one piece of that. PAM handles the rest.</p>
<p>More precisely: LDAP doesn&#8217;t know what a Linux session is. It doesn&#8217;t know about <code class="" data-line="">/etc/pam.d/</code>. It doesn&#8217;t enforce login hours, account expiry, or concurrent session limits. It returns directory entries and verifies binds. The intelligence about what to do with those results lives in the Linux authentication stack.</p>
<p>When you run <code class="" data-line="">ssh vamshi@server</code>, the OS doesn&#8217;t open an LDAP connection and ask &#8220;can this user log in?&#8221; It calls PAM. PAM consults its configuration, and PAM decides whether to call LDAP (directly or via SSSD), whether to check the shadow file, whether to enforce MFA. LDAP is one possible backend. It&#8217;s not the gatekeeper.</p>
<hr />
<h2 id="nss-the-traffic-controller">NSS: The Traffic Controller</h2>
<p>Before PAM runs, Linux needs to know if the user exists at all. That&#8217;s NSS&#8217;s job.</p>
<p><code class="" data-line="">/etc/nsswitch.conf</code> is a routing table for name resolution. It tells the OS where to look when something asks &#8220;who is UID 1001?&#8221; or &#8220;what groups is vamshi in?&#8221;:</p>
<pre><code class="" data-line=""># /etc/nsswitch.conf

passwd:     files sss        ← user lookups: check /etc/passwd first, then SSSD
group:      files sss        ← group lookups: check /etc/group first, then SSSD
shadow:     files sss        ← shadow password lookups
hosts:      files dns        ← hostname lookups (not identity-related)
netgroup:   sss              ← NIS netgroups from SSSD only
automount:  sss              ← autofs maps from SSSD
</code></pre>
<p>Every call to <code class="" data-line="">getpwnam()</code>, <code class="" data-line="">getpwuid()</code>, <code class="" data-line="">getgrnam()</code>, <code class="" data-line="">getgrgid()</code> in any process — including <code class="" data-line="">sshd</code> — goes through NSS. The entries in nsswitch.conf control which backends are tried in order.</p>
<p>With <code class="" data-line="">passwd: files sss</code>, a lookup for user <code class="" data-line="">vamshi</code>:<br />
1. Checks <code class="" data-line="">/etc/passwd</code> — not found (vamshi is a domain user, not in local files)<br />
2. Queries SSSD — SSSD checks its cache, or queries LDAP, and returns the <code class="" data-line="">posixAccount</code> attributes</p>
<p>Without the <code class="" data-line="">sss</code> entry in <code class="" data-line="">passwd:</code>, domain users don&#8217;t exist on the system — <code class="" data-line="">getent passwd vamshi</code> returns nothing, <code class="" data-line="">id vamshi</code> fails, SSH login never gets to PAM&#8217;s authentication step.</p>
<pre><code class="" data-line=""># Verify NSS is routing to SSSD correctly
getent passwd vamshi
# vamshi:*:1001:1001:Vamshi K:/home/vamshi:/bin/bash

# If this returns nothing, NSS isn&#039;t reaching SSSD
# Check: systemctl status sssd &amp;&amp; grep passwd /etc/nsswitch.conf

# See what groups the user is in (NSS group lookup)
id vamshi
# uid=1001(vamshi) gid=1001(engineers) groups=1001(engineers),1002(ops)
</code></pre>
<hr />
<h2 id="pam-the-real-gatekeeper">PAM: The Real Gatekeeper</h2>
<p>PAM (Pluggable Authentication Modules) is the framework that lets Linux swap authentication backends without recompiling anything. Every service that needs to authenticate users — <code class="" data-line="">sshd</code>, <code class="" data-line="">sudo</code>, <code class="" data-line="">login</code>, <code class="" data-line="">su</code>, <code class="" data-line="">gdm</code> — has a PAM configuration file in <code class="" data-line="">/etc/pam.d/</code>.</p>
<p>Each PAM config defines four stacks:</p>
<pre><code class="" data-line="">auth        ← verify credentials (password, key, MFA)
account     ← check if the account is valid (not expired, not locked, login hours)
password    ← password change policy
session     ← set up/tear down the session (home dir, limits, logging)
</code></pre>
<p>A typical <code class="" data-line="">/etc/pam.d/sshd</code> on a system joined to AD via SSSD:</p>
<pre><code class="" data-line=""># /etc/pam.d/sshd

# auth stack — verify the user&#039;s credentials
auth    required      pam_sepermit.so
auth    substack      password-auth   ← usually includes pam_sss.so

# account stack — check account validity
account required      pam_nologin.so
account include       password-auth

# password stack — handle password changes
password include      password-auth

# session stack — set up the session
session required      pam_selinux.so close
session required      pam_loginuid.so
session optional      pam_keyinit.so force revoke
session include       password-auth
session optional      pam_motd.so
session optional      pam_mkhomedir.so skel=/etc/skel/ umask=0077
session required      pam_selinux.so open
</code></pre>
<p>The <code class="" data-line="">include</code> and <code class="" data-line="">substack</code> directives pull in shared stacks from other files (like <code class="" data-line="">/etc/pam.d/password-auth</code>). On a system with SSSD, <code class="" data-line="">password-auth</code> contains:</p>
<pre><code class="" data-line="">auth    required      pam_env.so
auth    sufficient    pam_sss.so      ← try SSSD first
auth    required      pam_deny.so     ← if pam_sss fails, deny

account required      pam_unix.so
account sufficient    pam_localuser.so
account sufficient    pam_sss.so      ← SSSD account check
account required      pam_permit.so

session optional      pam_sss.so      ← SSSD session tracking
</code></pre>
<p>The <code class="" data-line="">sufficient</code> flag means: if this module succeeds, stop checking this stack and consider it passed. <code class="" data-line="">required</code> means: this must pass (but continue checking other modules and report failure at the end). <code class="" data-line="">requisite</code> means: if this fails, stop immediately.</p>
<hr />
<h2 id="pam-control-flags-at-a-glance">PAM Control Flags at a Glance</h2>
<pre><code class="" data-line="">required   — must succeed; failure reported after remaining modules run
requisite  — must succeed; failure reported immediately, stack stops
sufficient — if success, stop stack (ignore remaining); failure continues
optional   — result ignored unless it&#039;s the only module in the stack
</code></pre>
<p>This matters for debugging. If <code class="" data-line="">pam_sss.so</code> is <code class="" data-line="">sufficient</code> and SSSD is down, PAM falls through to <code class="" data-line="">pam_deny.so</code> — login denied. If it were <code class="" data-line="">optional</code>, the login would proceed to the next module. The control flag is the policy decision.</p>
<hr />
<h2 id="the-old-way-pam_ldap">The Old Way: pam_ldap</h2>
<p>Before SSSD, Linux systems used <code class="" data-line="">pam_ldap</code> and <code class="" data-line="">nss_ldap</code> directly:</p>
<pre><code class="" data-line=""># Old /etc/pam.d/common-auth (Ubuntu pre-SSSD era)
auth    sufficient    pam_ldap.so    ← direct LDAP connection per login
auth    required      pam_unix.so nullok_secure

# Old /etc/nsswitch.conf
passwd: files ldap    ← nss_ldap for user lookups
group:  files ldap
</code></pre>
<p><code class="" data-line="">pam_ldap</code> opened a fresh LDAP connection on every login attempt. No caching. If the LDAP server was unreachable for 3 seconds, the login hung for 3 seconds — sometimes much longer. If the LDAP server was down, all domain logins failed immediately. Previously logged-in users with active sessions were fine; new logins simply didn&#8217;t work.</p>
<p><code class="" data-line="">nss_ldap</code> had the same problem for NSS lookups: every <code class="" data-line="">getpwnam()</code> call hit the LDAP server directly. On a busy system with many processes doing user lookups, this meant hundreds of LDAP queries per second, no connection reuse, and no way to survive a brief network blip.</p>
<p>The problems were structural:<br />
&#8211; No credential caching — offline logins impossible<br />
&#8211; No connection pooling — LDAP server saw one connection per login attempt<br />
&#8211; No failover logic — one LDAP server down meant all logins down<br />
&#8211; Slow timeouts that blocked login sessions</p>
<p>SSSD was built to fix all of this.</p>
<hr />
<h2 id="the-modern-way-pam_sss-sssd">The Modern Way: pam_sss + SSSD</h2>
<p><code class="" data-line="">pam_sss</code> doesn&#8217;t talk to LDAP directly. It&#8217;s a thin client that passes authentication requests to SSSD over a Unix domain socket. SSSD manages the LDAP connection, the credential cache, and the failover logic.</p>
<pre><code class="" data-line="">sshd  →  PAM (pam_sss)  →  SSSD (Unix socket)  →  LDAP server
                                   │
                                   └── credential cache
                                       (survives brief LDAP outages)
</code></pre>
<p>When <code class="" data-line="">pam_sss</code> sends a credential to SSSD:<br />
1. SSSD checks its in-memory cache — if the credential hash matches a recent successful auth, it can satisfy the request without hitting LDAP<br />
2. If not cached (or cache expired), SSSD sends a Bind to the LDAP server<br />
3. On success, SSSD caches the result and returns success to <code class="" data-line="">pam_sss</code><br />
4. <code class="" data-line="">pam_sss</code> returns PAM_SUCCESS, and the auth stack continues</p>
<p>The credential cache is what enables offline logins. If the LDAP server is unreachable and a user has authenticated successfully within the cache TTL (default: 1 day for credentials, configurable via <code class="" data-line="">cache_credentials = True</code> in sssd.conf), SSSD satisfies the auth from cache and the login succeeds. The user never knows the LDAP server was down.</p>
<hr />
<h2 id="tracing-a-full-ssh-login">Tracing a Full SSH Login</h2>
<p>Here&#8217;s every step of an SSH login for a domain user, in order:</p>
<pre><code class="" data-line="">1.  sshd accepts the TCP connection
2.  sshd calls PAM: pam_start(&quot;sshd&quot;, &quot;vamshi&quot;, ...)

3.  PAM auth stack runs pam_sss:
      pam_sss sends credentials to SSSD via /var/lib/sss/pipes/pam

4.  SSSD auth provider:
      a. Check credential cache — miss (first login)
      b. Resolve user: NSS lookup for uid=vamshi
         → SSSD LDAP provider searches dc=corp,dc=com for (uid=vamshi)
         → Returns: uidNumber=1001, gidNumber=1001, homeDirectory=/home/vamshi
      c. Authenticate: LDAP Simple Bind as uid=vamshi,ou=engineers,dc=corp,dc=com
         → Server returns: success
      d. Cache the credential hash + POSIX attrs

5.  SSSD returns PAM_SUCCESS to pam_sss

6.  PAM account stack runs pam_sss:
      SSSD checks: account not expired, not locked, login permitted
      → PAM_ACCT_MGMT success

7.  PAM session stack:
      pam_loginuid sets /proc/self/loginuid = 1001
      pam_mkhomedir creates /home/vamshi if missing
      pam_sss opens session (records in SSSD session tracking)

8.  sshd creates the shell, sets environment:
      USER=vamshi, HOME=/home/vamshi, SHELL=/bin/bash, LOGNAME=vamshi

9.  Shell prompt appears
</code></pre>
<p>Steps 4b and 4c are the only two LDAP operations in the entire login flow: one Search to resolve the user&#8217;s attributes, one Bind to verify the password. Everything else is PAM and SSSD.</p>
<hr />
<h2 id="debugging-the-stack">Debugging the Stack</h2>
<p>When a login fails, the failure could be in any layer. Work top-down:</p>
<pre><code class="" data-line=""># 1. Does NSS resolve the user at all?
getent passwd vamshi
# If empty: NSS isn&#039;t reaching SSSD, or SSSD isn&#039;t finding the user in LDAP

# 2. Is SSSD running and healthy?
systemctl status sssd
sssctl domain-status corp.com      # shows SSSD&#039;s view of domain connectivity

# 3. What does SSSD think about the user?
sssctl user-checks vamshi          # runs auth + account checks internally
id vamshi                          # forces NSS resolution and shows group memberships

# 4. What does SSSD&#039;s log say?
journalctl -u sssd -f              # tail SSSD logs live, then attempt login

# 5. Can you reach the LDAP server at all?
ldapsearch -x -H ldap://dc.corp.com \
  -D &quot;cn=svc-ldap,ou=services,dc=corp,dc=com&quot; \
  -w &quot;password&quot; \
  -b &quot;dc=corp,dc=com&quot; \
  &quot;(uid=vamshi)&quot; dn

# 6. Force a cache flush if entries are stale
sss_cache -u vamshi                # invalidate this user&#039;s cache entry
sss_cache -G engineers             # invalidate a group
</code></pre>
<p>The <code class="" data-line="">sssctl user-checks</code> command is the single most useful diagnostic — it simulates the full PAM auth + account check flow without actually creating a session, and prints exactly what SSSD would do on a real login attempt.</p>
<hr />
<h2 id="common-misconceptions"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/26a0.png" alt="⚠" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Common Misconceptions</h2>
<p><strong>&#8220;If ldapsearch works, SSH login should work.&#8221;</strong> Not necessarily. <code class="" data-line="">ldapsearch</code> tests the LDAP layer. An SSH login requires NSS to resolve the user, PAM to authenticate, SSSD to be running and configured correctly, and <code class="" data-line="">pam_mkhomedir</code> to create the home directory if it&#8217;s the first login. Any of these can fail independently.</p>
<p><strong>&#8220;pam_ldap and pam_sss do the same thing.&#8221;</strong> They have the same job (authenticate via LDAP) but completely different architectures. <code class="" data-line="">pam_ldap</code> is a direct-connect, no-cache module. <code class="" data-line="">pam_sss</code> is a client of SSSD, which provides caching, connection pooling, failover, and offline support. On any modern system, you want <code class="" data-line="">pam_sss</code>.</p>
<p><strong>&#8220;nsswitch.conf order doesn&#8217;t matter much.&#8221;</strong> It matters exactly as much as the order suggests. <code class="" data-line="">passwd: files sss</code> means local <code class="" data-line="">/etc/passwd</code> is always checked first — if a domain username collides with a local user, the local account wins. This is the intended behavior (local accounts should always be reachable), but it means you&#8217;ll never override a local account with a directory entry.</p>
<p><strong>&#8220;SSSD cache = security risk.&#8221;</strong> The cache stores a credential hash, not the cleartext password. An attacker with access to the SSSD cache database (<code class="" data-line="">/var/lib/sss/db/</code>) would see hashed credentials — the same situation as <code class="" data-line="">/etc/shadow</code>. The real concern is whether offline authentication is appropriate for your security posture; it can be disabled with <code class="" data-line="">offline_credentials_expiration = 0</code>.</p>
<hr />
<h2 id="framework-alignment">Framework Alignment</h2>
<table>
<thead>
<tr>
<th>Domain</th>
<th>Relevance</th>
</tr>
</thead>
<tbody>
<tr>
<td>CISSP Domain 5: Identity and Access Management</td>
<td>PAM is the enforcement layer for authentication policy on Linux — understanding its stack is foundational to any Linux IAM deployment</td>
</tr>
<tr>
<td>CISSP Domain 3: Security Architecture and Engineering</td>
<td>The separation between NSS (resolution) and PAM (authentication) is an architectural boundary — misunderstanding it leads to misconfigured systems where account checks are bypassed</td>
</tr>
<tr>
<td>CISSP Domain 4: Communications and Network Security</td>
<td>pam_ldap vs pam_sss affects whether credentials travel over a direct LDAP connection (one socket per login, no TLS guarantee) or through SSSD&#8217;s managed, pooled connection</td>
</tr>
</tbody>
</table>
<hr />
<h2 id="key-takeaways">Key Takeaways</h2>
<ul>
<li>LDAP alone is not an authentication protocol for Linux — authentication flows through PAM, and LDAP is one of PAM&#8217;s possible backends</li>
<li>NSS (<code class="" data-line="">/etc/nsswitch.conf</code>) resolves user identity (who is UID 1001?); PAM enforces it (are they allowed in?)</li>
<li><code class="" data-line="">pam_ldap</code> talks to LDAP directly — no cache, no failover, login blocked when LDAP is unreachable</li>
<li><code class="" data-line="">pam_sss</code> delegates to SSSD — credential caching, connection pooling, offline login, and failover are all built in</li>
<li>A full SSH login touches LDAP exactly twice: one Search for POSIX attributes, one Bind to verify the password</li>
<li>When login fails, debug top-down: NSS resolution → SSSD status → LDAP reachability → PAM config</li>
</ul>
<hr />
<h2 id="whats-next">What&#8217;s Next</h2>
<p>EP03 showed how authentication reaches LDAP — through PAM, through SSSD, through a Bind. What it assumed is that SSSD is healthy and the LDAP server is reachable. The moment either goes wrong, the behavior depends entirely on how SSSD is configured — its cache TTLs, its failover order, its offline credential policy.</p>
<p>EP04 goes inside SSSD: the architecture, the sssd.conf knobs that matter, how to read the logs, and how to break it intentionally and fix it.</p>
<p><em>Next: <a href="/sssd-linux-authentication/">SSSD: The Caching Daemon That Powers Every Enterprise Linux Login</a></em></p>
<p>Get EP04 in your inbox when it publishes → <a href="https://linuxcent.com/subscribe">linuxcent.com/subscribe</a></p>
<p><a class="a2a_button_mastodon" href="https://www.addtoany.com/add_to/mastodon?linkurl=https%3A%2F%2Flinuxcent.com%2Fldap-authentication-linux-pam-nss%2F&amp;linkname=How%20LDAP%20Authentication%20Works%20on%20Linux%3A%20PAM%2C%20NSS%2C%20and%20the%20Login%20Stack" title="Mastodon" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_email" href="https://www.addtoany.com/add_to/email?linkurl=https%3A%2F%2Flinuxcent.com%2Fldap-authentication-linux-pam-nss%2F&amp;linkname=How%20LDAP%20Authentication%20Works%20on%20Linux%3A%20PAM%2C%20NSS%2C%20and%20the%20Login%20Stack" title="Email" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_whatsapp" href="https://www.addtoany.com/add_to/whatsapp?linkurl=https%3A%2F%2Flinuxcent.com%2Fldap-authentication-linux-pam-nss%2F&amp;linkname=How%20LDAP%20Authentication%20Works%20on%20Linux%3A%20PAM%2C%20NSS%2C%20and%20the%20Login%20Stack" title="WhatsApp" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Flinuxcent.com%2Fldap-authentication-linux-pam-nss%2F&amp;linkname=How%20LDAP%20Authentication%20Works%20on%20Linux%3A%20PAM%2C%20NSS%2C%20and%20the%20Login%20Stack" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_x" href="https://www.addtoany.com/add_to/x?linkurl=https%3A%2F%2Flinuxcent.com%2Fldap-authentication-linux-pam-nss%2F&amp;linkname=How%20LDAP%20Authentication%20Works%20on%20Linux%3A%20PAM%2C%20NSS%2C%20and%20the%20Login%20Stack" title="X" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Flinuxcent.com%2Fldap-authentication-linux-pam-nss%2F&amp;linkname=How%20LDAP%20Authentication%20Works%20on%20Linux%3A%20PAM%2C%20NSS%2C%20and%20the%20Login%20Stack" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_copy_link" href="https://www.addtoany.com/add_to/copy_link?linkurl=https%3A%2F%2Flinuxcent.com%2Fldap-authentication-linux-pam-nss%2F&amp;linkname=How%20LDAP%20Authentication%20Works%20on%20Linux%3A%20PAM%2C%20NSS%2C%20and%20the%20Login%20Stack" title="Copy Link" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Flinuxcent.com%2Fldap-authentication-linux-pam-nss%2F&#038;title=How%20LDAP%20Authentication%20Works%20on%20Linux%3A%20PAM%2C%20NSS%2C%20and%20the%20Login%20Stack" data-a2a-url="https://linuxcent.com/ldap-authentication-linux-pam-nss/" data-a2a-title="How LDAP Authentication Works on Linux: PAM, NSS, and the Login Stack"></a></p><p>The post <a href="https://linuxcent.com/ldap-authentication-linux-pam-nss/">How LDAP Authentication Works on Linux: PAM, NSS, and the Login Stack</a> appeared first on <a href="https://linuxcent.com">Linuxcent</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://linuxcent.com/ldap-authentication-linux-pam-nss/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1777</post-id>	</item>
		<item>
		<title>LDAP Internals: The Directory Tree, Schema, and What Travels on the Wire</title>
		<link>https://linuxcent.com/ldap-internals-directory-structure/</link>
					<comments>https://linuxcent.com/ldap-internals-directory-structure/#respond</comments>
		
		<dc:creator><![CDATA[Vamshi Krishna Santhapuri]]></dc:creator>
		<pubDate>Fri, 24 Apr 2026 19:41:04 +0000</pubDate>
				<category><![CDATA[Identity & Authentication]]></category>
		<category><![CDATA[Authentication]]></category>
		<category><![CDATA[Directory Services]]></category>
		<category><![CDATA[Identity Management]]></category>
		<category><![CDATA[LDAP]]></category>
		<category><![CDATA[LDAP Schema]]></category>
		<category><![CDATA[ldapsearch]]></category>
		<category><![CDATA[Linux]]></category>
		<guid isPermaLink="false">https://linuxcent.com/ldap-internals-directory-structure/</guid>

					<description><![CDATA[<p><span class="span-reading-time rt-reading-time" style="display: block;"><span class="rt-label rt-prefix">Reading Time: </span> <span class="rt-time"> 12</span> <span class="rt-label rt-postfix">minutes</span></span>Understand LDAP internals: the DIT hierarchy, DN syntax, object classes, schema, and the BER-encoded bytes that travel from directory server to authentication daemon.</p>
<p>The post <a href="https://linuxcent.com/ldap-internals-directory-structure/">LDAP Internals: The Directory Tree, Schema, and What Travels on the Wire</a> appeared first on <a href="https://linuxcent.com">Linuxcent</a>.</p>
]]></description>
										<content:encoded><![CDATA[<span class="span-reading-time rt-reading-time" style="display: block;"><span class="rt-label rt-prefix">Reading Time: </span> <span class="rt-time"> 12</span> <span class="rt-label rt-postfix">minutes</span></span><style>
pre{position:relative;background:#1e1e1e;color:#d4d4d4;
    padding:16px 16px 16px 20px;border-radius:6px;overflow-x:auto;
    font-family:'JetBrains Mono','Fira Code','Cascadia Code',Consolas,'Courier New',monospace;
    font-size:.88em;line-height:1.6;border-left:4px solid #555}
code{background:#f4f4f4;padding:2px 5px;border-radius:3px;font-size:.9em}
pre code{background:transparent;padding:0;color:inherit}
pre[data-lang="bash"],pre[data-lang="sh"],
pre[data-lang="shell"],pre[data-lang="zsh"]{border-left-color:#4ec9b0}
pre[data-lang="yaml"],pre[data-lang="json"],
pre[data-lang="toml"],pre[data-lang="xml"]{border-left-color:#569cd6}
pre[data-lang="python"],pre[data-lang="go"],pre[data-lang="rust"],
pre[data-lang="java"],pre[data-lang="c"],pre[data-lang="cpp"]{border-left-color:#c586c0}
pre[data-lang="text"],pre[data-lang="output"],
pre[data-lang="console"]{border-left-color:#888}
.lc-copy-btn{position:absolute;top:8px;right:8px;background:#2d2d2d;color:#ccc;
    border:1px solid #444;border-radius:4px;padding:3px 9px;font-size:.75em;
    font-family:system-ui,sans-serif;cursor:pointer;opacity:0;
    transition:opacity .15s,background .15s;line-height:1.6}
pre:hover .lc-copy-btn{opacity:1}
.lc-copy-btn:hover{background:#3a3a3a;color:#fff}
.lc-copy-btn.copied{color:#4ec9b0;border-color:#4ec9b0}
.lc-lang-badge{position:absolute;top:8px;left:20px;font-family:system-ui,sans-serif;
    font-size:.7em;color:#666;text-transform:uppercase;letter-spacing:.04em;
    line-height:1;pointer-events:none;opacity:0;transition:opacity .15s}
pre:hover .lc-lang-badge{opacity:1}
table{border-collapse:collapse;width:100%;margin:16px 0}
th,td{border:1px solid #ddd;padding:10px 14px;text-align:left}
th{background:#f0f0f0;font-weight:600}
tr:nth-child(even){background:#fafafa}
</style>
<p><script>
(function(){
  if(window.__lcCodeEnhanced)return;
  window.__lcCodeEnhanced=true;
  function enhance(){
    document.querySelectorAll('pre').forEach(function(pre){
      var code=pre.querySelector('code');
      var lang='';
      if(code){var m=(code.className||'').match(/language-(\S+)/);if(m)lang=m[1].toLowerCase();}
      if(lang)pre.setAttribute('data-lang',lang);
      if(lang){var badge=document.createElement('span');badge.className='lc-lang-badge';badge.textContent=lang;pre.insertBefore(badge,pre.firstChild);}
      var btn=document.createElement('button');
      btn.className='lc-copy-btn';btn.textContent='Copy';btn.setAttribute('aria-label','Copy code to clipboard');
      pre.appendChild(btn);
      btn.addEventListener('click',function(){
        var text=code?code.innerText:pre.innerText;
        if(navigator.clipboard&&window.isSecureContext){
          navigator.clipboard.writeText(text).then(function(){ok(btn);}).catch(function(){fb(text,btn);});
        }else{fb(text,btn);}
      });
    });
  }
  function ok(btn){btn.textContent='Copied!';btn.classList.add('copied');setTimeout(function(){btn.textContent='Copy';btn.classList.remove('copied');},2000);}
  function fb(text,btn){
    try{var ta=document.createElement('textarea');ta.value=text;ta.style.cssText='position:fixed;left:-9999px;top:-9999px;opacity:0';document.body.appendChild(ta);ta.select();document.execCommand('copy');document.body.removeChild(ta);ok(btn);}
    catch(e){btn.textContent='✗ Failed';setTimeout(function(){btn.textContent='Copy';},2000);}
  }
  if(document.readyState==='loading'){document.addEventListener('DOMContentLoaded',enhance);}else{enhance();}
})();
</script></p>
<p><em>The Identity Stack, Episode 2</em><br />
<a href="/what-is-ldap/">EP01: What Is LDAP</a> → <strong>EP02</strong> → <a href="/ldap-authentication-linux-pam-nss/">EP03: LDAP Authentication on Linux</a> → &#8230;</p>
<hr />
<h2 id="tldr">TL;DR</h2>
<ul>
<li>The Directory Information Tree (DIT) is the hierarchical database LDAP stores — every entry lives at a unique path described by its Distinguished Name (DN)</li>
<li>Object classes define what attributes an entry is allowed or required to have — <code class="" data-line="">posixAccount</code> adds UID, GID, and home directory; <code class="" data-line="">inetOrgPerson</code> adds email and display name</li>
<li>Schema is the rulebook: which attribute types exist across the entire directory, what syntax each follows, and which object classes require or permit them</li>
<li>An LDAP Search sends four things: a base DN, a scope (base/one/sub), a filter like <code class="" data-line="">(uid=vamshi)</code>, and a list of attributes to return — the server traverses the tree and returns LDIF</li>
<li>Every LDAP message on the wire is BER-encoded (Basic Encoding Rules, a subset of ASN.1) — a compact binary format, not text</li>
<li><code class="" data-line="">ldapsearch</code> output is LDIF (LDAP Data Interchange Format) — the human-readable representation of what the BER payload carried</li>
</ul>
<hr />
<h2 id="the-big-picture-from-ldapsearch-to-directory-entry">The Big Picture: From ldapsearch to Directory Entry</h2>
<pre><code class="" data-line="">ldapsearch -x -H ldap://dc.corp.com -b &quot;dc=corp,dc=com&quot; &quot;(uid=vamshi)&quot; cn mail uidNumber
     │
     │  TCP port 389 (or 636 for LDAPS)
     │  BER-encoded SearchRequest
     ▼
┌─────────────────────────────────────────────────┐
│  LDAP Server (AD / OpenLDAP / 389-DS / FreeIPA)  │
│                                                   │
│  Directory Information Tree                       │
│                                                   │
│  dc=corp,dc=com                    ← search base  │
│    └── ou=engineers                ← scope: sub   │
│          ├── uid=alice                            │
│          └── uid=vamshi  ← filter match           │
│                cn: vamshi                         │
│                mail: vamshi@corp.com              │
│                uidNumber: 1001                    │
└─────────────────────────────────────────────────┘
     │
     │  BER-encoded SearchResultEntry
     ▼
# LDIF output on your terminal
dn: uid=vamshi,ou=engineers,dc=corp,dc=com
cn: vamshi
mail: vamshi@corp.com
uidNumber: 1001
</code></pre>
<p>LDAP internals are the mechanics between the command you type and the directory entry you get back. EP01 explained why LDAP was invented. This episode explains what it actually does when you run it.</p>
<hr />
<h2 id="the-directory-information-tree">The Directory Information Tree</h2>
<p>EP01 introduced the DIT as a concept inherited from X.500. Here&#8217;s what it actually looks like inside a directory.</p>
<p>Every LDAP directory has a root — the base DN — from which all entries descend. For a company called Corp with a domain <code class="" data-line="">corp.com</code>, the base is typically <code class="" data-line="">dc=corp,dc=com</code>. Below that, the tree branches into organizational units, and below those, individual entries for people, groups, services, and anything else the directory administrator decided to model.</p>
<pre><code class="" data-line="">dc=corp,dc=com                          ← domain root (base DN)
│
├── ou=people                           ← organizational unit: people
│     ├── uid=alice                     ← user entry
│     ├── uid=vamshi
│     └── uid=bob
│
├── ou=groups                           ← organizational unit: groups
│     ├── cn=engineers
│     └── cn=ops
│
├── ou=services                         ← organizational unit: service accounts
│     ├── cn=jenkins
│     └── cn=gitlab-runner
│
└── ou=hosts                            ← organizational unit: machines
      ├── cn=web01.corp.com
      └── cn=db01.corp.com
</code></pre>
<p>This hierarchy is not a file system and not a relational database. It is specifically optimized for reads — the query &#8220;give me everything about this user&#8221; is the operation the protocol is built around. Writes are infrequent. Reads are constant.</p>
<p>Every entry in the tree has exactly one parent. There are no cross-links between branches, no foreign keys. The tree is the structure. An entry&#8217;s position in the tree is what defines it.</p>
<hr />
<h2 id="distinguished-names-reading-the-path">Distinguished Names: Reading the Path</h2>
<p>The Distinguished Name (DN) is how you address any entry in the directory. It reads right-to-left, from the leaf to the root, with each component separated by a comma.</p>
<pre><code class="" data-line="">uid=vamshi,ou=engineers,dc=corp,dc=com

Reading right-to-left:
  dc=corp,dc=com       ← domain: corp.com
  ou=engineers         ← organizational unit: engineers
  uid=vamshi           ← this specific entry: user &quot;vamshi&quot;
</code></pre>
<p>Each component of a DN — <code class="" data-line="">uid=vamshi</code>, <code class="" data-line="">ou=engineers</code>, <code class="" data-line="">dc=corp</code> — is a Relative Distinguished Name (RDN). The RDN is the attribute-value pair that uniquely identifies the entry within its parent container. Two users in the same <code class="" data-line="">ou=engineers</code> cannot both have <code class="" data-line="">uid=vamshi</code> — that would create two entries with identical DNs, which the directory won&#8217;t allow.</p>
<p>Common RDN attribute types and what they mean:</p>
<table>
<thead>
<tr>
<th>Attribute</th>
<th>Stands for</th>
<th>Typical use</th>
</tr>
</thead>
<tbody>
<tr>
<td><code class="" data-line="">dc</code></td>
<td>Domain Component</td>
<td>Domain name segments (<code class="" data-line="">dc=corp,dc=com</code> = corp.com)</td>
</tr>
<tr>
<td><code class="" data-line="">ou</code></td>
<td>Organizational Unit</td>
<td>Container for grouping entries</td>
</tr>
<tr>
<td><code class="" data-line="">cn</code></td>
<td>Common Name</td>
<td>Groups, service accounts, human-readable name</td>
</tr>
<tr>
<td><code class="" data-line="">uid</code></td>
<td>User ID</td>
<td>Linux username — the standard RDN for user entries</td>
</tr>
<tr>
<td><code class="" data-line="">o</code></td>
<td>Organization</td>
<td>Top-level org containers (less common in modern setups)</td>
</tr>
</tbody>
</table>
<p>When your Linux system calls <code class="" data-line="">getent passwd vamshi</code>, SSSD translates that into an LDAP Search for an entry where <code class="" data-line="">uid=vamshi</code> somewhere under the configured base DN. The full DN comes back with the result, but what your system cares about are the attributes inside it.</p>
<hr />
<h2 id="object-classes-and-schema">Object Classes and Schema</h2>
<p>Every entry in the directory has a <code class="" data-line="">objectClass</code> attribute — usually several values. Object classes define what attributes the entry is allowed or required to have.</p>
<pre><code class="" data-line=""># A typical user entry&#039;s object classes
dn: uid=vamshi,ou=engineers,dc=corp,dc=com
objectClass: top
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: shadowAccount
</code></pre>
<p>Each object class contributes a set of attributes — some required (<code class="" data-line="">MUST</code>), some optional (<code class="" data-line="">MAY</code>):</p>
<pre><code class="" data-line="">objectClass: posixAccount
  MUST: cn, uid, uidNumber, gidNumber, homeDirectory
  MAY:  userPassword, loginShell, gecos, description

objectClass: inetOrgPerson
  MUST: sn (surname), cn
  MAY:  mail, telephoneNumber, displayName, jpegPhoto, ...

objectClass: shadowAccount
  MUST: uid
  MAY:  shadowLastChange, shadowMin, shadowMax, shadowWarning, ...
</code></pre>
<p>When Linux authenticates a user via LDAP, it needs the <code class="" data-line="">posixAccount</code> attributes: <code class="" data-line="">uidNumber</code> (the numeric UID), <code class="" data-line="">gidNumber</code>, <code class="" data-line="">homeDirectory</code>, and <code class="" data-line="">loginShell</code>. Without <code class="" data-line="">posixAccount</code>, the user entry exists in the directory but can&#8217;t be used for Linux logins — <code class="" data-line="">getent passwd</code> will return nothing.</p>
<p>Object classes are grouped into three kinds:</p>
<p>Groups in LDAP use their own object class:</p>
<pre><code class="" data-line="">objectClass: groupOfNames
  MUST: cn, member
  MAY:  description, owner, ...

# A group entry looks like this:
dn: cn=engineers,ou=groups,dc=corp,dc=com
objectClass: groupOfNames
cn: engineers
member: uid=vamshi,ou=engineers,dc=corp,dc=com
member: uid=alice,ou=engineers,dc=corp,dc=com
</code></pre>
<p><code class="" data-line="">groupOfNames</code> stores members as full DNs — which is why the SSSD group search filter is <code class="" data-line="">(member=uid=vamshi,ou=...)</code> rather than <code class="" data-line="">(member=vamshi)</code>. The directory stores the exact path to each member entry. <code class="" data-line="">posixGroup</code> is the alternative, which stores the <code class="" data-line="">memberUid</code> as a bare username string instead of a DN — Active Directory uses <code class="" data-line="">groupOfNames</code>; pure POSIX environments often use <code class="" data-line="">posixGroup</code>.</p>
<p>Object classes are grouped into three kinds:</p>
<p><strong>Structural</strong> — defines what the entry fundamentally is. Every entry must have exactly one structural class. <code class="" data-line="">posixAccount</code> is structural.</p>
<p><strong>Auxiliary</strong> — adds additional attributes to an existing entry. <code class="" data-line="">shadowAccount</code> and <code class="" data-line="">inetOrgPerson</code> can be auxiliary. You can stack multiple auxiliary classes on a single entry.</p>
<p><strong>Abstract</strong> — base classes that other classes inherit from. <code class="" data-line="">top</code> is the root abstract class that every entry implicitly has. You never add <code class="" data-line="">top</code> to an entry; it&#8217;s always there.</p>
<h3 id="schema-the-directorys-type-system">Schema: The Directory&#8217;s Type System</h3>
<p>Schema is the global rulebook for the entire directory. It defines:</p>
<ul>
<li><strong>Attribute type definitions</strong> — what each attribute is named, what syntax it uses (a string? an integer? a binary blob?), whether it&#8217;s case-sensitive, whether multiple values are allowed</li>
<li><strong>Object class definitions</strong> — which attributes each class requires or permits</li>
<li><strong>Matching rules</strong> — how equality comparisons work for each attribute type</li>
</ul>
<p>The schema is stored in the directory itself, under a special entry at <code class="" data-line="">cn=schema,cn=config</code> (OpenLDAP) or <code class="" data-line="">cn=Schema,cn=Configuration</code> (Active Directory). You can query it:</p>
<pre><code class="" data-line=""># View the schema for the posixAccount object class
ldapsearch -x -H ldap://your-dc \
  -b &quot;cn=schema,cn=config&quot; \
  &quot;(objectClass=olcObjectClasses)&quot; \
  olcObjectClasses | grep -A 10 &quot;posixAccount&quot;

# Output:
# olcObjectClasses: ( 1.3.6.1.1.1.2.0
#   NAME &#039;posixAccount&#039;
#   DESC &#039;Abstraction of an account with POSIX attributes&#039;
#   SUP top
#   AUXILIARY
#   MUST ( cn $ uid $ uidNumber $ gidNumber $ homeDirectory )
#   MAY ( userPassword $ loginShell $ gecos $ description ) )
</code></pre>
<p>That OID (<code class="" data-line="">1.3.6.1.1.1.2.0</code>) is the globally unique identifier for the <code class="" data-line="">posixAccount</code> object class. Every object class and attribute type in every LDAP directory on the planet has a unique OID assigned by an authority. This is how schema interoperability works across different directory implementations — OpenLDAP, Active Directory, and 389-DS can all understand each other&#8217;s <code class="" data-line="">posixAccount</code> entries because they share the same OID.</p>
<hr />
<h2 id="ldap-operations-what-actually-runs">LDAP Operations: What Actually Runs</h2>
<p>LDAP defines eight operations. Day-to-day authentication uses two: Bind and Search.</p>
<pre><code class="" data-line="">LDAP Operation Set
──────────────────
Bind        ← authenticate (prove identity)
Search      ← query the directory
Add         ← create a new entry
Modify      ← change attributes on an existing entry
Delete      ← remove an entry
ModifyDN    ← rename or move an entry
Compare     ← test if an attribute has a specific value
Abandon     ← cancel an outstanding operation
</code></pre>
<h3 id="bind-proving-who-you-are">Bind: Proving Who You Are</h3>
<p>Before any authenticated operation, the client sends a Bind request. There are two types:</p>
<p><strong>Simple Bind</strong> — the client sends its DN and password in the clear (or over TLS). This is what <code class="" data-line="">-x</code> in <code class="" data-line="">ldapsearch</code> means: simple authentication.</p>
<pre><code class="" data-line=""># Simple bind as a service account
ldapsearch -x \
  -D &quot;cn=svc-ldap-reader,ou=services,dc=corp,dc=com&quot; \
  -w &quot;service-account-password&quot; \
  -H ldap://dc.corp.com \
  -b &quot;dc=corp,dc=com&quot; \
  &quot;(uid=vamshi)&quot;
</code></pre>
<p><strong>SASL Bind</strong> — the client uses an authentication mechanism registered with SASL (Simple Authentication and Security Layer). Kerberos (via the GSSAPI mechanism) is the most common. EP05 covers Kerberos in detail.</p>
<pre><code class="" data-line=""># SASL bind using Kerberos (after kinit)
ldapsearch -Y GSSAPI \
  -H ldap://dc.corp.com \
  -b &quot;dc=corp,dc=com&quot; \
  &quot;(uid=vamshi)&quot;
</code></pre>
<p>An anonymous Bind (no DN, no password) is also valid for directories configured to allow anonymous reads. Many public LDAP directories (and some internal ones, misconfigured) allow this.</p>
<h3 id="search-the-core-operation">Search: The Core Operation</h3>
<p>A Search request has five required parameters:</p>
<pre><code class="" data-line="">baseObject   — where in the DIT to start (e.g., &quot;dc=corp,dc=com&quot;)
scope        — how deep to look
               base    = only the base entry itself
               one     = one level below base (immediate children)
               sub     = entire subtree below base (most common)
derefAliases — how to handle alias entries (usually derefAlways)
filter       — what to match (e.g., &quot;(uid=vamshi)&quot;)
attributes   — which attributes to return (empty = return all)
</code></pre>
<p>When SSSD authenticates a user login, it runs exactly two Search operations:</p>
<pre><code class="" data-line="">Search 1 — find the user&#039;s entry
  base:       dc=corp,dc=com
  scope:      sub
  filter:     (uid=vamshi)
  attributes: dn, uid, uidNumber, gidNumber, homeDirectory, loginShell

Search 2 — find the user&#039;s group memberships
  base:       dc=corp,dc=com
  scope:      sub
  filter:     (member=uid=vamshi,ou=engineers,dc=corp,dc=com)
  attributes: dn, cn, gidNumber
</code></pre>
<p>The first search locates the user entry and retrieves the POSIX attributes. The second finds all group entries that contain the user&#8217;s DN as a member. These two queries are the complete basis for a Linux login over LDAP.</p>
<h3 id="search-filters">Search Filters</h3>
<p>LDAP filters follow a prefix (Polish notation) syntax. Every filter is wrapped in parentheses:</p>
<pre><code class="" data-line=""># Simple equality
(uid=vamshi)

# Presence — entry has this attribute at all
(mail=*)

# Substring match
(cn=vam*)

# Comparison
(uidNumber&gt;=1000)

# Logical AND — both conditions must match
(&amp;(objectClass=posixAccount)(uid=vamshi))

# Logical OR — either condition matches
(|(uid=vamshi)(mail=vamshi@corp.com))

# Logical NOT
(!(uid=guest))

# Combined — posixAccount entries with UID &gt;= 1000 and no disabled flag
(&amp;(objectClass=posixAccount)(uidNumber&gt;=1000)(!(pwdAccountLockedTime=*)))
</code></pre>
<p>The <code class="" data-line="">&amp;</code> and <code class="" data-line="">|</code> operators take any number of operands. Filter syntax looks strange the first time but is unambiguous and compact — which matters when you&#8217;re encoding it into BER for the wire.</p>
<hr />
<h2 id="what-actually-travels-on-the-wire">What Actually Travels on the Wire</h2>
<p>Every LDAP message is encoded in BER (Basic Encoding Rules), a binary subset of ASN.1. LDAP is not a text protocol.</p>
<p>When you run <code class="" data-line="">ldapsearch</code>, the tool constructs a BER-encoded <code class="" data-line="">SearchRequest</code> message and sends it over TCP. The server responds with one or more <code class="" data-line="">SearchResultEntry</code> messages (one per matching entry), followed by a <code class="" data-line="">SearchResultDone</code>. All of these are BER.</p>
<p>BER uses a type-length-value (TLV) encoding:</p>
<pre><code class="" data-line="">Tag byte(s)    — what type of data this is
Length byte(s) — how many bytes of data follow
Value byte(s)  — the actual data
</code></pre>
<p>A minimal LDAP SearchRequest for <code class="" data-line="">ldapsearch -x -b &quot;dc=corp,dc=com&quot; &quot;(uid=vamshi)&quot; uid</code> looks like this on the wire:</p>
<pre><code class="" data-line="">30 45          ← SEQUENCE (LDAPMessage)
  02 01 01     ← INTEGER 1 (messageID = 1)
  63 40        ← [APPLICATION 3] SearchRequest
    04 11       ← OCTET STRING: baseObject
      64 63 3d  ← &quot;dc=corp,dc=com&quot; (20 bytes)
      63 6f 72
      70 2c 64
      63 3d 63
      6f 6d
    0a 01 02   ← ENUMERATED: scope = wholeSubtree (2)
    0a 01 03   ← ENUMERATED: derefAliases = derefAlways (3)
    02 01 00   ← INTEGER: sizeLimit = 0 (unlimited)
    02 01 00   ← INTEGER: timeLimit = 0 (unlimited)
    01 01 00   ← BOOLEAN: typesOnly = false
    a7 0f      ← [7] equalityMatch filter
      04 03 75 69 64   ← attributeDesc: &quot;uid&quot;
      04 06 76 61 6d   ← assertionValue: &quot;vamshi&quot;
             73 68 69
    30 05      ← SEQUENCE: AttributeDescriptionList
      04 03 75 69 64   ← &quot;uid&quot;
</code></pre>
<p>You don&#8217;t need to read BER by hand in practice. But knowing it&#8217;s binary — not HTTP, not JSON, not plain text — explains some things:</p>
<ul>
<li>Why <code class="" data-line="">tcpdump port 389</code> shows binary output you can&#8217;t read directly</li>
<li>Why LDAP on port 389 looks different in Wireshark than HTTP traffic</li>
<li>Why <code class="" data-line="">ldapsearch</code> output (LDIF) is a transformation of the wire data, not the wire data itself</li>
</ul>
<p>To see the wire protocol in action:</p>
<pre><code class="" data-line=""># Run ldapsearch with debug output (level 1 = protocol tracing)
ldapsearch -d 1 -x \
  -H ldap://ldap.forumsys.com \
  -b &quot;dc=example,dc=com&quot; \
  -D &quot;cn=read-only-admin,dc=example,dc=com&quot; \
  -w readonly \
  &quot;(uid=tesla)&quot; cn

# You&#039;ll see output like:
# ldap_connect_to_host: TCP ldap.forumsys.com:389
# ldap_new_connection 1 1 0
# ldap_connect_to_host: Trying ldap.forumsys.com:389
# ldap_pvt_connect: fd: 5 tm: -1 async: 0
# TLS: can&#039;t connect.
# ldap_open_defconn: successful
# ber_scanf fmt ({it) ber:     ← BER decoding of the response
# ber_scanf fmt ({) ber:
# ber_scanf fmt (W) ber:
# ...
</code></pre>
<p>The <code class="" data-line="">ber_scanf</code> lines are the BER decoder working through the server&#8217;s response. Each line represents one TLV element being read off the wire.</p>
<hr />
<h2 id="reading-ldapsearch-output-every-field">Reading ldapsearch Output: Every Field</h2>
<p><code class="" data-line="">ldapsearch</code> output is LDIF (LDAP Data Interchange Format), defined in RFC 2849. It&#8217;s the standard text serialization of LDAP entries.</p>
<pre><code class="" data-line="">ldapsearch -x \
  -H ldap://ldap.forumsys.com \
  -b &quot;dc=example,dc=com&quot; \
  -D &quot;cn=read-only-admin,dc=example,dc=com&quot; \
  -w readonly \
  &quot;(uid=tesla)&quot; \
  cn mail uid uidNumber objectClass
</code></pre>
<p>Output, annotated:</p>
<pre><code class="" data-line=""># extended LDIF
#
# LDAPv3                              ← protocol version confirmed
# base &lt;dc=example,dc=com&gt; with scope subtree
# filter: (uid=tesla)                 ← your search filter echoed back
# requesting: cn mail uid uidNumber objectClass
#

# tesla, example.com                  ← comment: CN, base DN
dn: uid=tesla,dc=example,dc=com      ← Distinguished Name — full path in the tree

objectClass: inetOrgPerson           ← structural class: person with org attrs
objectClass: organizationalPerson    ← auxiliary: adds telephoneNumber etc.
objectClass: person                  ← auxiliary: adds sn (surname)
objectClass: top                     ← every entry has this implicitly
cn: Tesla                            ← common name (from inetOrgPerson MUST)
mail: tesla@ldap.forumsys.com        ← email (from inetOrgPerson MAY)
uid: tesla                           ← userid (from inetOrgPerson MAY)

# search result
search: 2                            ← messageID of the SearchResultDone
result: 0 Success                    ← 0 = no error; 32 = no such object; 49 = invalid credentials

# numResponses: 2                    ← 1 result entry + 1 SearchResultDone
# numEntries: 1
</code></pre>
<p>The <code class="" data-line="">result:</code> line is the one to watch when debugging. LDAP result codes:</p>
<table>
<thead>
<tr>
<th>Code</th>
<th>Meaning</th>
<th>What it tells you</th>
</tr>
</thead>
<tbody>
<tr>
<td>0</td>
<td>Success</td>
<td>Query ran, results returned (or no results found — check numEntries)</td>
</tr>
<tr>
<td>32</td>
<td>No Such Object</td>
<td>Base DN doesn&#8217;t exist in this directory</td>
</tr>
<tr>
<td>49</td>
<td>Invalid Credentials</td>
<td>Bind failed — wrong DN, wrong password, or account locked</td>
</tr>
<tr>
<td>50</td>
<td>Insufficient Access</td>
<td>Your bind DN doesn&#8217;t have read permission on these entries</td>
</tr>
<tr>
<td>53</td>
<td>Unwilling to Perform</td>
<td>Server refused the operation (e.g., password policy, anonymous bind disabled)</td>
</tr>
<tr>
<td>65</td>
<td>Object Class Violation</td>
<td>Add/Modify would violate schema (missing MUST attribute, unrecognized object class)</td>
</tr>
</tbody>
</table>
<hr />
<h2 id="ports-389-636-and-3268">Ports: 389, 636, and 3268</h2>
<pre><code class="" data-line="">Port 389   — LDAP (plaintext, or StartTLS in-session upgrade)
Port 636   — LDAPS (LDAP wrapped in TLS from the start)
Port 3268  — Active Directory Global Catalog (plain)
Port 3269  — Active Directory Global Catalog over TLS
</code></pre>
<p><strong>Port 389 vs 636:</strong> Both carry the same BER-encoded LDAP protocol. The difference is when TLS starts. On 636 (LDAPS), the TLS handshake happens before the first LDAP message. On 389 with StartTLS, the client sends a plaintext <code class="" data-line="">ExtendedRequest</code> with OID <code class="" data-line="">1.3.6.1.4.1.1466.20037</code> to initiate the TLS upgrade, then both sides continue over TLS. In production, use one or the other — never unencrypted port 389. Your credentials transit the wire on every Bind.</p>
<p><strong>Ports 3268/3269 — Active Directory Global Catalog:</strong> AD organizes domains into forests. Each domain controller holds the full LDAP tree for its own domain. The Global Catalog is a read-only, partial replica of every domain in the forest — just the most-queried attributes from every object. When an application needs to find a user across domains in the same forest (not just in one domain), it queries the Global Catalog on 3268/3269 instead of a domain-specific DC on 389/636.</p>
<pre><code class="" data-line="">Forest: corp.com
  ├── Domain: corp.com       → DC at port 389/636   (full copy of corp.com)
  ├── Domain: emea.corp.com  → DC at port 389/636   (full copy of emea.corp.com)
  └── Global Catalog        → GC at port 3268/3269  (partial copy of ALL domains)
</code></pre>
<p>If your SSSD or application is configured to use port 3268 instead of 389, it&#8217;s talking to the Global Catalog — useful for forest-wide user lookups, but missing some less-common attributes that aren&#8217;t replicated to the GC.</p>
<hr />
<h2 id="try-it-ldapsearch-against-your-own-directory">Try It: ldapsearch Against Your Own Directory</h2>
<p>If your Linux machine is joined to AD or connected to an LDAP directory, you can run these right now:</p>
<pre><code class="" data-line=""># 1. Confirm your SSSD knows where the LDAP server is
grep -E &quot;ldap_uri|ad_domain|krb5_server&quot; /etc/sssd/sssd.conf

# 2. Look up your own user entry
ldapsearch -x \
  -H ldap://$(grep ldap_uri /etc/sssd/sssd.conf | awk -F= &#039;{print $2}&#039; | tr -d &#039; &#039;) \
  -b &quot;dc=$(hostname -d | sed &#039;s/\./,dc=/g&#039;)&quot; \
  &quot;(uid=$(whoami))&quot; \
  dn objectClass uid uidNumber gidNumber homeDirectory loginShell

# 3. Find the groups you&#039;re in
ldapsearch -x \
  -H ldap://your-dc \
  -b &quot;dc=corp,dc=com&quot; \
  &quot;(member=$(ldapsearch -x ... &quot;(uid=$(whoami))&quot; dn | grep ^dn | cut -d&#039; &#039; -f2-))&quot; \
  cn gidNumber

# 4. Check what object classes your entry has
ldapsearch -x \
  -H ldap://your-dc \
  -b &quot;dc=corp,dc=com&quot; \
  &quot;(uid=$(whoami))&quot; \
  objectClass
</code></pre>
<p>On a machine joined to Active Directory, the <code class="" data-line="">ldap_uri</code> in sssd.conf is your domain controller&#8217;s address. On FreeIPA or OpenLDAP, it&#8217;s the directory server. The same <code class="" data-line="">ldapsearch</code> commands work against all of them — because they all speak LDAP v3.</p>
<hr />
<h2 id="common-misconceptions"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/26a0.png" alt="⚠" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Common Misconceptions</h2>
<p><strong>&#8220;The DN is like a file path.&#8221;</strong> The analogy holds for reading it, but the DIT is not a file system. Entries don&#8217;t inherit permissions from parent containers the way files inherit from directories. Access control in LDAP is defined by ACLs on the server — not by position in the tree.</p>
<p><strong>&#8220;LDAP is case-sensitive.&#8221;</strong> It depends on the attribute. Most string attributes (like <code class="" data-line="">cn</code> and <code class="" data-line="">mail</code>) use case-insensitive matching by default — <code class="" data-line="">(cn=Vamshi)</code> and <code class="" data-line="">(cn=vamshi)</code> return the same results. But some attributes (like <code class="" data-line="">userPassword</code> and most binary types) are case-sensitive. The schema&#8217;s matching rules define this per-attribute.</p>
<p><strong>&#8220;You need the full DN to search for a user.&#8221;</strong> No. The <code class="" data-line="">Search</code> operation with a <code class="" data-line="">sub</code> scope searches the entire subtree below the base DN. You search with a filter like <code class="" data-line="">(uid=vamshi)</code> without knowing the full DN. The DN comes back in the result.</p>
<p><strong>&#8220;LDAP accounts and Linux accounts are the same thing.&#8221;</strong> An LDAP user entry becomes a Linux account only if the entry has a <code class="" data-line="">posixAccount</code> object class with the required POSIX attributes (<code class="" data-line="">uidNumber</code>, <code class="" data-line="">gidNumber</code>, <code class="" data-line="">homeDirectory</code>). An LDAP entry without <code class="" data-line="">posixAccount</code> can exist in the directory but <code class="" data-line="">getent passwd</code> will not return it.</p>
<p><strong>&#8220;The objectClass attribute can be changed freely.&#8221;</strong> Structural object classes cannot be changed after an entry is created — you&#8217;d have to delete and recreate the entry. Auxiliary classes can be added or removed. This is why correctly choosing the structural class at entry creation time matters.</p>
<hr />
<h2 id="framework-alignment">Framework Alignment</h2>
<table>
<thead>
<tr>
<th>Domain</th>
<th>Relevance</th>
</tr>
</thead>
<tbody>
<tr>
<td>CISSP Domain 5: Identity and Access Management</td>
<td>DIT structure, DN addressing, object classes, and schema are the data model underpinning every enterprise identity store — understanding them is foundational to managing directory-based IAM</td>
</tr>
<tr>
<td>CISSP Domain 4: Communications and Network Security</td>
<td>BER on port 389 is unencrypted; LDAPS (port 636) or StartTLS is required for production — wire-level understanding informs the transport security decision</td>
</tr>
<tr>
<td>CISSP Domain 3: Security Architecture and Engineering</td>
<td>Schema design and DIT hierarchy are architectural decisions with security consequences: overly permissive schemas enable privilege escalation; flat DITs make access delegation harder</td>
</tr>
</tbody>
</table>
<hr />
<h2 id="key-takeaways">Key Takeaways</h2>
<ul>
<li>The DIT is a hierarchical database — every entry has a unique DN that describes its path from leaf to root</li>
<li>Object classes define the schema rules for each entry: what attributes are required (<code class="" data-line="">MUST</code>) vs optional (<code class="" data-line="">MAY</code>), and what the entry fundamentally is</li>
<li>For a user to be usable for Linux logins, the directory entry needs the <code class="" data-line="">posixAccount</code> object class with <code class="" data-line="">uidNumber</code>, <code class="" data-line="">gidNumber</code>, and <code class="" data-line="">homeDirectory</code> populated</li>
<li>An LDAP login is two operations: a Bind (authenticate), then a Search (retrieve POSIX attributes and group memberships)</li>
<li>Everything on the wire is BER-encoded binary — <code class="" data-line="">ldapsearch</code> output is LDIF, a human-readable transformation of what the wire actually carries</li>
<li>LDAP result code 0 means success; 49 means bad credentials; 32 means the base DN doesn&#8217;t exist — these are the three you&#8217;ll debug most often</li>
</ul>
<hr />
<hr />
<p>Run <code class="" data-line="">ldapsearch</code> against your own directory and look at the object classes on your entry. Does it have <code class="" data-line="">posixAccount</code>? Does it have <code class="" data-line="">shadowAccount</code>? What attributes is your SSSD actually reading on every login — and what does it do when the LDAP server is unreachable? <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f447.png" alt="👇" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<hr />
<h2 id="whats-next">What&#8217;s Next</h2>
<p>EP02 showed what&#8217;s inside the directory: the tree structure, the schema, the operations, and the wire protocol. What it left open is how Linux actually uses this information to grant a login.</p>
<p>LDAP is not, by itself, an authentication protocol. The Bind operation can verify a password — but that&#8217;s a tiny piece of what happens when you SSH into a machine joined to Active Directory. The full login flow runs through PAM, NSS, and SSSD before LDAP ever gets queried. EP03 traces that path.</p>
<p><em>Next: <a href="/ldap-authentication-linux-pam-nss/">LDAP Authentication on Linux: PAM, NSS, and the Login Stack</a></em></p>
<p>Get EP03 in your inbox when it publishes → <a href="https://linuxcent.com/subscribe">linuxcent.com/subscribe</a></p>
<p><a class="a2a_button_mastodon" href="https://www.addtoany.com/add_to/mastodon?linkurl=https%3A%2F%2Flinuxcent.com%2Fldap-internals-directory-structure%2F&amp;linkname=LDAP%20Internals%3A%20The%20Directory%20Tree%2C%20Schema%2C%20and%20What%20Travels%20on%20the%20Wire" title="Mastodon" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_email" href="https://www.addtoany.com/add_to/email?linkurl=https%3A%2F%2Flinuxcent.com%2Fldap-internals-directory-structure%2F&amp;linkname=LDAP%20Internals%3A%20The%20Directory%20Tree%2C%20Schema%2C%20and%20What%20Travels%20on%20the%20Wire" title="Email" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_whatsapp" href="https://www.addtoany.com/add_to/whatsapp?linkurl=https%3A%2F%2Flinuxcent.com%2Fldap-internals-directory-structure%2F&amp;linkname=LDAP%20Internals%3A%20The%20Directory%20Tree%2C%20Schema%2C%20and%20What%20Travels%20on%20the%20Wire" title="WhatsApp" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Flinuxcent.com%2Fldap-internals-directory-structure%2F&amp;linkname=LDAP%20Internals%3A%20The%20Directory%20Tree%2C%20Schema%2C%20and%20What%20Travels%20on%20the%20Wire" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_x" href="https://www.addtoany.com/add_to/x?linkurl=https%3A%2F%2Flinuxcent.com%2Fldap-internals-directory-structure%2F&amp;linkname=LDAP%20Internals%3A%20The%20Directory%20Tree%2C%20Schema%2C%20and%20What%20Travels%20on%20the%20Wire" title="X" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Flinuxcent.com%2Fldap-internals-directory-structure%2F&amp;linkname=LDAP%20Internals%3A%20The%20Directory%20Tree%2C%20Schema%2C%20and%20What%20Travels%20on%20the%20Wire" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_copy_link" href="https://www.addtoany.com/add_to/copy_link?linkurl=https%3A%2F%2Flinuxcent.com%2Fldap-internals-directory-structure%2F&amp;linkname=LDAP%20Internals%3A%20The%20Directory%20Tree%2C%20Schema%2C%20and%20What%20Travels%20on%20the%20Wire" title="Copy Link" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Flinuxcent.com%2Fldap-internals-directory-structure%2F&#038;title=LDAP%20Internals%3A%20The%20Directory%20Tree%2C%20Schema%2C%20and%20What%20Travels%20on%20the%20Wire" data-a2a-url="https://linuxcent.com/ldap-internals-directory-structure/" data-a2a-title="LDAP Internals: The Directory Tree, Schema, and What Travels on the Wire"></a></p><p>The post <a href="https://linuxcent.com/ldap-internals-directory-structure/">LDAP Internals: The Directory Tree, Schema, and What Travels on the Wire</a> appeared first on <a href="https://linuxcent.com">Linuxcent</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://linuxcent.com/ldap-internals-directory-structure/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1771</post-id>	</item>
		<item>
		<title>What Is LDAP — and Why It Was Invented to Replace Something Worse</title>
		<link>https://linuxcent.com/what-is-ldap/</link>
					<comments>https://linuxcent.com/what-is-ldap/#respond</comments>
		
		<dc:creator><![CDATA[Vamshi Krishna Santhapuri]]></dc:creator>
		<pubDate>Fri, 24 Apr 2026 04:43:19 +0000</pubDate>
				<category><![CDATA[Identity & Authentication]]></category>
		<category><![CDATA[Authentication]]></category>
		<category><![CDATA[Directory Services]]></category>
		<category><![CDATA[Enterprise IT]]></category>
		<category><![CDATA[Identity Management]]></category>
		<category><![CDATA[LDAP]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux-security]]></category>
		<guid isPermaLink="false">https://linuxcent.com/what-is-ldap/</guid>

					<description><![CDATA[<p><span class="span-reading-time rt-reading-time" style="display: block;"><span class="rt-label rt-prefix">Reading Time: </span> <span class="rt-time"> 9</span> <span class="rt-label rt-postfix">minutes</span></span>LDAP solved 1980s authentication chaos and still powers enterprise logins today. Learn what it replaced, how it works, and why it's still in your stack.</p>
<p>The post <a href="https://linuxcent.com/what-is-ldap/">What Is LDAP — and Why It Was Invented to Replace Something Worse</a> appeared first on <a href="https://linuxcent.com">Linuxcent</a>.</p>
]]></description>
										<content:encoded><![CDATA[<span class="span-reading-time rt-reading-time" style="display: block;"><span class="rt-label rt-prefix">Reading Time: </span> <span class="rt-time"> 9</span> <span class="rt-label rt-postfix">minutes</span></span><style>
pre{position:relative;background:#1e1e1e;color:#d4d4d4;
    padding:16px 16px 16px 20px;border-radius:6px;overflow-x:auto;
    font-family:'JetBrains Mono','Fira Code','Cascadia Code',Consolas,'Courier New',monospace;
    font-size:.88em;line-height:1.6;border-left:4px solid #555}
code{background:#f4f4f4;padding:2px 5px;border-radius:3px;font-size:.9em}
pre code{background:transparent;padding:0;color:inherit}
pre[data-lang="bash"],pre[data-lang="sh"],
pre[data-lang="shell"],pre[data-lang="zsh"]{border-left-color:#4ec9b0}
pre[data-lang="yaml"],pre[data-lang="json"],
pre[data-lang="toml"],pre[data-lang="xml"]{border-left-color:#569cd6}
pre[data-lang="python"],pre[data-lang="go"],pre[data-lang="rust"],
pre[data-lang="java"],pre[data-lang="c"],pre[data-lang="cpp"]{border-left-color:#c586c0}
pre[data-lang="text"],pre[data-lang="output"],
pre[data-lang="console"]{border-left-color:#888}
.lc-copy-btn{position:absolute;top:8px;right:8px;background:#2d2d2d;color:#ccc;
    border:1px solid #444;border-radius:4px;padding:3px 9px;font-size:.75em;
    font-family:system-ui,sans-serif;cursor:pointer;opacity:0;
    transition:opacity .15s,background .15s;line-height:1.6}
pre:hover .lc-copy-btn{opacity:1}
.lc-copy-btn:hover{background:#3a3a3a;color:#fff}
.lc-copy-btn.copied{color:#4ec9b0;border-color:#4ec9b0}
.lc-lang-badge{position:absolute;top:8px;left:20px;font-family:system-ui,sans-serif;
    font-size:.7em;color:#666;text-transform:uppercase;letter-spacing:.04em;
    line-height:1;pointer-events:none;opacity:0;transition:opacity .15s}
pre:hover .lc-lang-badge{opacity:1}
table{border-collapse:collapse;width:100%;margin:16px 0}
th,td{border:1px solid #ddd;padding:10px 14px;text-align:left}
th{background:#f0f0f0;font-weight:600}
tr:nth-child(even){background:#fafafa}
</style>
<p><script>
(function(){
  if(window.__lcCodeEnhanced)return;
  window.__lcCodeEnhanced=true;
  function enhance(){
    document.querySelectorAll('pre').forEach(function(pre){
      var code=pre.querySelector('code');
      var lang='';
      if(code){var m=(code.className||'').match(/language-(\S+)/);if(m)lang=m[1].toLowerCase();}
      if(lang)pre.setAttribute('data-lang',lang);
      if(lang){var badge=document.createElement('span');badge.className='lc-lang-badge';badge.textContent=lang;pre.insertBefore(badge,pre.firstChild);}
      var btn=document.createElement('button');
      btn.className='lc-copy-btn';btn.textContent='Copy';btn.setAttribute('aria-label','Copy code to clipboard');
      pre.appendChild(btn);
      btn.addEventListener('click',function(){
        var text=code?code.innerText:pre.innerText;
        if(navigator.clipboard&&window.isSecureContext){
          navigator.clipboard.writeText(text).then(function(){ok(btn);}).catch(function(){fb(text,btn);});
        }else{fb(text,btn);}
      });
    });
  }
  function ok(btn){btn.textContent='Copied!';btn.classList.add('copied');setTimeout(function(){btn.textContent='Copy';btn.classList.remove('copied');},2000);}
  function fb(text,btn){
    try{var ta=document.createElement('textarea');ta.value=text;ta.style.cssText='position:fixed;left:-9999px;top:-9999px;opacity:0';document.body.appendChild(ta);ta.select();document.execCommand('copy');document.body.removeChild(ta);ok(btn);}
    catch(e){btn.textContent='✗ Failed';setTimeout(function(){btn.textContent='Copy';},2000);}
  }
  if(document.readyState==='loading'){document.addEventListener('DOMContentLoaded',enhance);}else{enhance();}
})();
</script></p>
<p><em>The Identity Stack, Episode 1</em><br />
<strong>EP01</strong> → <a href="/ldap-internals-directory-structure/">EP02: LDAP Internals</a> → EP03 → &#8230;</p>
<hr />
<h2 id="tldr">TL;DR</h2>
<ul>
<li>LDAP (Lightweight Directory Access Protocol) is a protocol for reading and writing directory information — most commonly, who is allowed to do what</li>
<li>It was built in 1993 as a &#8220;lightweight&#8221; alternative to X.500/DAP, which ran over the full OSI stack and was impossible to deploy on anything but mainframe hardware</li>
<li>Before LDAP, every server had its own <code class="" data-line="">/etc/passwd</code> — 50 machines meant 50 separate user databases, managed manually</li>
<li>NIS (Network Information Service) was the first attempt to centralize this — it worked, then became a cleartext-credentials security liability</li>
<li>LDAP v3 (RFC 2251, 1997) is the version still in production today — 27 years of backwards compatibility</li>
<li>Everything you use today — Active Directory, Okta, Entra ID — is built on top of, or speaks, LDAP</li>
</ul>
<hr />
<h2 id="the-big-picture-50-years-of-who-are-you">The Big Picture: 50 Years of &#8220;Who Are You?&#8221;</h2>
<pre><code class="" data-line="">1969–1980s   /etc/passwd — per-machine, no network auth
     │        50 servers = 50 user databases, managed manually
     │
     ▼
1984         Sun NIS / Yellow Pages — first centralized directory
     │        broadcast-based, no encryption, flat namespace
     │        Revolutionary for its era. A liability by the 1990s.
     │
     ▼
1988         X.500 / DAP — enterprise-grade directory services
     │        OSI protocol stack. Powerful. Impossible to deploy.
     │        Mainframe-class infrastructure required just to run it.
     │
     ▼
1993         RFC 1487 — LDAP v1
     │        Tim Howes, University of Michigan.
     │        Lightweight. TCP/IP. Actually deployable.
     │
     ▼
1997         RFC 2251 — LDAP v3
     │        SASL authentication. TLS. Controls. Referrals.
     │        The version still in production today.
     │
     ▼
2000s–now    Active Directory, OpenLDAP, 389-DS, FreeIPA
             Okta, Entra ID, Google Workspace
             LDAP DNA in every identity system on the planet.
</code></pre>
<p>What is LDAP? It&#8217;s the protocol that solved one of the most boring and consequential problems in computing: how do you know who someone is, across machines, at scale, without sending their password in cleartext?</p>
<hr />
<h2 id="the-world-before-ldap">The World Before LDAP</h2>
<p>Before you understand why LDAP was invented, you need to feel the problem it solved.</p>
<p>Every Unix machine in the 1970s and 1980s managed its own users. When you created an account on a server, your username, UID, and hashed password went into <code class="" data-line="">/etc/passwd</code> on that machine. Another machine had no idea you existed. If you needed access to ten servers, an administrator created ten separate accounts — manually, one by one. When you changed your password, each account had to be updated separately.</p>
<p>For a university with 200 machines and 10,000 students, this was chaos. For a company with offices in three cities, it was a full-time job for multiple sysadmins.</p>
<pre><code class="" data-line="">Machine A           Machine B           Machine C
/etc/passwd         /etc/passwd         /etc/passwd
vamshi:x:1001       (vamshi unknown)    vamshi:x:1004
alice:x:1002        alice:x:1001        alice:x:1003
bob:x:1003          bob:x:1002          (bob unknown)

Same people, different UIDs, different machines, no central truth.
File permissions become meaningless when UID 1001 means
different users on different hosts.
</code></pre>
<p>For every new hire, an admin SSHed to every machine and ran <code class="" data-line="">useradd</code>. When someone left, you hoped whoever ran the offboarding remembered all the machines. Most organizations didn&#8217;t know their own attack surface because there was no single place to look.</p>
<hr />
<h3 id="sun-nis-the-first-attempt-at-centralization">Sun NIS: The First Attempt at Centralization</h3>
<p>Sun Microsystems released NIS (Network Information Service) in 1984, originally called Yellow Pages — a name they had to drop after a trademark dispute with British Telecom. The idea was elegant: one server holds the authoritative <code class="" data-line="">/etc/passwd</code> (and <code class="" data-line="">/etc/group</code>, <code class="" data-line="">/etc/hosts</code>, and a dozen other maps), and client machines query it instead of reading local files.</p>
<p>For the first time, you could create an account once and have it work across your entire network. For a generation of Unix administrators, NIS was liberating.</p>
<pre><code class="" data-line="">       NIS Master Server
       /var/yp/passwd.byname
              │
    ┌─────────┼──────────┐
    ▼         ▼          ▼
 Client A   Client B   Client C
 (query NIS — no local /etc/passwd needed)
</code></pre>
<p>NIS worked well — until it didn&#8217;t. The failure modes were structural:</p>
<p><strong>No encryption.</strong> NIS responses were cleartext UDP. An attacker on the same network segment could capture the full password database with a packet sniffer. In 1984, &#8220;the network&#8221; meant a trusted corporate LAN. By the mid-1990s, it meant ethernet segments that included lab workstations, and the assumptions no longer held.</p>
<p><strong>Broadcast-based discovery.</strong> NIS clients found servers by broadcasting on the local network. This worked on a single flat ethernet. It failed completely across routers, across buildings, and across WAN links. Multi-site organizations ended up running separate NIS domains with no connection between them — which partially defeated the purpose.</p>
<p><strong>Flat namespace.</strong> NIS had no organizational hierarchy. One domain. Everything flat. You couldn&#8217;t have <code class="" data-line="">engineering</code> and <code class="" data-line="">finance</code> as separate administrative units. You couldn&#8217;t delegate user management to a department. One person — usually one overworked sysadmin — managed the whole thing.</p>
<p><strong>UIDs had to match across all machines.</strong> If <code class="" data-line="">alice</code> was UID 1002 on one server but UID 1001 on another, NFS file ownership became wrong. NIS enforced consistency, but onboarding a new machine into an existing network required manually auditing UID conflicts across the entire directory. Get one wrong and files end up owned by the wrong person.</p>
<p>NIS worked for thousands of installations from 1984 to the mid-1990s. It also ended careers when it failed. What the industry needed was a hierarchical, structured, encrypted, scalable directory service.</p>
<hr />
<h2 id="x500-and-dap-the-right-idea-wrong-protocol">X.500 and DAP: The Right Idea, Wrong Protocol</h2>
<p>The OSI (Open Systems Interconnection) standards body had an answer: X.500 directory services. X.500 was comprehensive, hierarchical, globally federated. The ITU-T published the standard in 1988, and it looked like exactly what enterprises needed.</p>
<pre><code class="" data-line="">X.500 Directory Information Tree (DIT)
              c=US                   ← country
                │
         o=University                ← organization
                │
         ┌──────┴──────┐
     ou=CS           ou=Physics      ← organizational units
         │
     cn=Tim Howes                    ← common name (person)
     telephoneNumber: +1-734-...
     mail: tim@umich.edu
</code></pre>
<p>This data model — the hierarchy, the object classes, the distinguished names — is exactly what LDAP inherited. The DIT, the <code class="" data-line="">cn=</code>, <code class="" data-line="">ou=</code>, <code class="" data-line="">dc=</code> notation in every LDAP query you&#8217;ve ever read: all of it came from X.500.</p>
<p>The problem was DAP: the Directory Access Protocol that X.500 used to communicate.</p>
<p>DAP ran over the full OSI protocol stack. Not TCP/IP — OSI. Seven layers, all of which required specialized software that in 1988 only mainframe and minicomputer vendors had implemented. A university department wanting to run X.500 needed hardware and software licenses that cost as much as a small car. The vast majority of workstations couldn&#8217;t speak OSI at all.</p>
<p>The data model was sound. The transport was impractical.</p>
<pre><code class="" data-line="">X.500 / DAP (1988)              LDAP v1 (1993)
──────────────────              ──────────────
Full OSI stack (7 layers)  →    TCP/IP only
Mainframe-class hardware   →    Any Unix box with a TCP stack
$50,000+ deployment cost   →    Free (reference implementation)
Vendor-specific OSI impl.  →    Standard socket API
Zero internet adoption     →    Universities deployed immediately
</code></pre>
<hr />
<h2 id="the-invention-ldap-at-the-university-of-michigan">The Invention: LDAP at the University of Michigan</h2>
<p>Tim Howes was at the University of Michigan in the early 1990s. The university was running X.500 for its directory — faculty, staff, student contact information, credentials. The data model was good. The protocol was the problem.</p>
<p>His insight, working with colleagues Wengyik Yeong and Steve Kille: strip X.500 down to what actually needs to function over a TCP/IP connection. Keep the hierarchical data model. Throw away the OSI transport. The result was the Lightweight Directory Access Protocol.</p>
<p>RFC 1487, published July 1993, described LDAP v1. It preserved the X.500 directory information model — the hierarchy, the object classes, the distinguished name format — and mapped it onto a protocol that could run over a simple TCP socket on port 389.</p>
<p>No specialized hardware. No OSI. If you had a Unix machine and TCP/IP, you could run LDAP. By 1993, that meant virtually every workstation and server in every university and most enterprises.</p>
<p>The University of Michigan deployed it immediately. Within two years, organizations across the internet were running the reference implementation.</p>
<p>LDAP v2 (RFC 1777, 1995) cleaned up the protocol. LDAP v3 (RFC 2251, 1997) is the version in production today — adding SASL authentication (which enables Kerberos integration), TLS support, referrals for federated directories, and extensible controls for server-side operations. The RFC that standardized the internet&#8217;s primary identity protocol is 27 years old and still running.</p>
<hr />
<h2 id="what-ldap-actually-is">What LDAP Actually Is</h2>
<p>LDAP is a client-server protocol for reading and writing a directory — a structured, hierarchical database optimized for reads.</p>
<p>Every entry in the directory has a Distinguished Name (DN) that describes its position in the hierarchy, and a set of attributes defined by its object classes. A person entry looks like this:</p>
<pre><code class="" data-line="">dn: cn=vamshi,ou=engineers,dc=linuxcent,dc=com

objectClass: inetOrgPerson
objectClass: posixAccount
cn: vamshi
uid: vamshi
uidNumber: 1001
gidNumber: 1001
homeDirectory: /home/vamshi
loginShell: /bin/bash
mail: vamshi@linuxcent.com
</code></pre>
<p>The DN reads right-to-left: domain <code class="" data-line="">linuxcent.com</code> (<code class="" data-line="">dc=linuxcent,dc=com</code>) → organizational unit <code class="" data-line="">engineers</code> → common name <code class="" data-line="">vamshi</code>. Every entry in the directory has a unique path through the tree — there&#8217;s no ambiguity about which <code class="" data-line="">vamshi</code> you mean.</p>
<p>LDAP defines eight operations: Bind (authenticate), Search, Add, Modify, Delete, ModifyDN (rename), Compare, and Abandon. Most of what a Linux authentication system does with LDAP reduces to two: <strong>Bind</strong> (prove you are who you say you are) and <strong>Search</strong> (tell me everything you know about this user).</p>
<p>When your Linux machine authenticates an SSH login against LDAP:</p>
<pre><code class="" data-line="">1. User types password
2. PAM calls pam_sss (or pam_ldap on older systems)
3. SSSD issues a Bind to the LDAP server: &quot;I am cn=vamshi, and here is my credential&quot;
4. LDAP server verifies the bind → success or failure
5. SSSD issues a Search: &quot;give me the posixAccount attributes for uid=vamshi&quot;
6. LDAP returns uidNumber, gidNumber, homeDirectory, loginShell
7. PAM creates the session with those attributes
</code></pre>
<p>The entire login flow is two LDAP operations: one Bind, one Search.</p>
<hr />
<h2 id="try-it-right-now">Try It Right Now</h2>
<p>You don&#8217;t need to set up an LDAP server to run your first query. There&#8217;s a public test LDAP directory at <code class="" data-line="">ldap.forumsys.com</code>:</p>
<pre><code class="" data-line=""># Query a public LDAP server — no setup required
ldapsearch -x \
  -H ldap://ldap.forumsys.com \
  -b &quot;dc=example,dc=com&quot; \
  -D &quot;cn=read-only-admin,dc=example,dc=com&quot; \
  -w readonly \
  &quot;(objectClass=inetOrgPerson)&quot; \
  cn mail uid

# What you get back (abbreviated):
# dn: uid=tesla,dc=example,dc=com
# cn: Tesla
# mail: tesla@ldap.forumsys.com
# uid: tesla
#
# dn: uid=einstein,dc=example,dc=com
# cn: Albert Einstein
# mail: einstein@ldap.forumsys.com
# uid: einstein
</code></pre>
<p>Decode what you just ran:</p>
<ul>
<li><code class="" data-line="">-x</code> — simple authentication (username/password bind, not Kerberos/SASL)</li>
<li><code class="" data-line="">-H ldap://ldap.forumsys.com</code> — the LDAP server URI, port 389</li>
<li><code class="" data-line="">-b &quot;dc=example,dc=com&quot;</code> — the base DN, the top of the subtree to search</li>
<li><code class="" data-line="">-D &quot;cn=read-only-admin,dc=example,dc=com&quot;</code> — the bind DN (who you&#8217;re authenticating as)</li>
<li><code class="" data-line="">-w readonly</code> — the bind password</li>
<li><code class="" data-line="">&quot;(objectClass=inetOrgPerson)&quot;</code> — the search filter: return entries that are people</li>
<li><code class="" data-line="">cn mail uid</code> — the attributes to return (default returns all)</li>
</ul>
<p>That&#8217;s a live LDAP query returning real directory entries from a server running RFC 2251 — the same protocol Tim Howes designed in 1993.</p>
<p>On your own Linux system, if you&#8217;re joined to AD or LDAP, you can query it the same way with your domain credentials.</p>
<hr />
<h2 id="why-it-never-went-away">Why It Never Went Away</h2>
<p>LDAP v3 was finalized in 1997. In 2024, it&#8217;s still the protocol every enterprise directory speaks. Why?</p>
<p>Because it became the lingua franca of enterprise identity before any replacement existed. Every application that needs to authenticate users — VPN concentrators, mail servers, network switches, web applications, HR systems — implemented LDAP support. Every directory service Microsoft, Red Hat, Sun, and Novell shipped stored data in an LDAP-accessible tree.</p>
<p>When Microsoft built Active Directory in 1999, they built it on top of LDAP + Kerberos. When your Linux machine joins an AD domain, it speaks LDAP to enumerate users and groups, and Kerberos to verify credentials. When Okta or Entra ID syncs with your on-premises directory, it uses LDAP Sync (or a modern protocol that maps directly to LDAP semantics).</p>
<p>The protocol is old. The ecosystem built on top of it is so deep that replacing LDAP would mean simultaneously replacing every enterprise application that depends on it. Nobody has done that. Nobody has had to.</p>
<p>What happened instead is the stack got taller. LDAP at the bottom, Kerberos for network authentication, SSSD as the local caching daemon, PAM as the Linux integration layer, SAML and OIDC at the top for web-based federation. The directory is still LDAP. The interfaces above it evolved.</p>
<p>That full stack — from the directory at the bottom to Zero Trust at the top — is what this series covers.</p>
<hr />
<h2 id="common-misconceptions"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/26a0.png" alt="⚠" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Common Misconceptions</h2>
<p><strong>&#8220;LDAP is an authentication protocol.&#8221;</strong> LDAP is a directory protocol. It stores identity information and can verify credentials (via Bind). Authentication in modern stacks is typically Kerberos or OIDC — LDAP provides the directory backing it.</p>
<p><strong>&#8220;LDAP is obsolete.&#8221;</strong> LDAP is the storage layer for Active Directory, OpenLDAP, 389-DS, FreeIPA, and every enterprise IdP&#8217;s on-premises sync. It is ubiquitous. What&#8217;s changed is the interface layer above it.</p>
<p><strong>&#8220;You need Active Directory to run LDAP.&#8221;</strong> Active Directory uses LDAP. OpenLDAP, 389-DS, FreeIPA, and Apache Directory Server are all standalone LDAP implementations. You can run a directory without Microsoft.</p>
<p><strong>&#8220;LDAP and LDAPS are different protocols.&#8221;</strong> LDAP is the protocol. LDAPS is LDAP over TLS on port 636. StartTLS is LDAP on port 389 with an in-session upgrade to TLS. Same protocol, different transport security.</p>
<hr />
<h2 id="framework-alignment">Framework Alignment</h2>
<table>
<thead>
<tr>
<th>Domain</th>
<th>Relevance</th>
</tr>
</thead>
<tbody>
<tr>
<td>CISSP Domain 5: Identity and Access Management</td>
<td>LDAP is the foundational directory protocol for centralized identity stores — the base layer of every enterprise IAM stack</td>
</tr>
<tr>
<td>CISSP Domain 4: Communications and Network Security</td>
<td>Port 389 (LDAP), 636 (LDAPS), 3268/3269 (AD Global Catalog) — transport security decisions affect every directory deployment</td>
</tr>
<tr>
<td>CISSP Domain 3: Security Architecture and Engineering</td>
<td>DIT hierarchy, schema design, replication topology — directory structure is an architectural security decision</td>
</tr>
<tr>
<td>NIST SP 800-63B</td>
<td>LDAP as a credential service provider (CSP) backing enterprise authenticators</td>
</tr>
</tbody>
</table>
<hr />
<h2 id="key-takeaways">Key Takeaways</h2>
<ul>
<li>LDAP was invented to solve a real, painful problem: the authentication chaos that NIS couldn&#8217;t fix and X.500/DAP was too expensive to deploy</li>
<li>It inherited the right thing from X.500 (the hierarchical data model) and replaced the right thing (the impractical OSI transport with TCP/IP)</li>
<li>NIS was the predecessor that worked until it didn&#8217;t — its failure modes (no encryption, flat namespace, broadcast discovery) are exactly what LDAP was designed to fix</li>
<li>LDAP v3 (RFC 2251, 1997) is still the production standard — 27 years later</li>
<li>Active Directory, OpenLDAP, FreeIPA, Okta, Entra ID — every enterprise identity system either runs LDAP or speaks it</li>
<li>The full authentication stack is deeper than LDAP: the next 12 episodes peel it apart layer by layer</li>
</ul>
<hr />
<h2 id="whats-next">What&#8217;s Next</h2>
<p>EP01 stayed at the design level — the problem, the predecessor failures, the invention, the data model.</p>
<p>EP02 goes inside the wire. The DIT structure, DN syntax, object classes, schema, and the BER-encoded bytes that actually travel from the server to your authentication daemon. Run <code class="" data-line="">ldapsearch</code> against your own directory and read every line of what comes back.</p>
<p><em>Next: <a href="/ldap-internals-directory-structure/">LDAP Internals: The Directory Tree, Schema, and What Travels on the Wire</a></em></p>
<p>Get EP02 in your inbox when it publishes → <a href="https://linuxcent.com/subscribe">linuxcent.com/subscribe</a></p>
<p><a class="a2a_button_mastodon" href="https://www.addtoany.com/add_to/mastodon?linkurl=https%3A%2F%2Flinuxcent.com%2Fwhat-is-ldap%2F&amp;linkname=What%20Is%20LDAP%20%E2%80%94%20and%20Why%20It%20Was%20Invented%20to%20Replace%20Something%20Worse" title="Mastodon" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_email" href="https://www.addtoany.com/add_to/email?linkurl=https%3A%2F%2Flinuxcent.com%2Fwhat-is-ldap%2F&amp;linkname=What%20Is%20LDAP%20%E2%80%94%20and%20Why%20It%20Was%20Invented%20to%20Replace%20Something%20Worse" title="Email" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_whatsapp" href="https://www.addtoany.com/add_to/whatsapp?linkurl=https%3A%2F%2Flinuxcent.com%2Fwhat-is-ldap%2F&amp;linkname=What%20Is%20LDAP%20%E2%80%94%20and%20Why%20It%20Was%20Invented%20to%20Replace%20Something%20Worse" title="WhatsApp" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Flinuxcent.com%2Fwhat-is-ldap%2F&amp;linkname=What%20Is%20LDAP%20%E2%80%94%20and%20Why%20It%20Was%20Invented%20to%20Replace%20Something%20Worse" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_x" href="https://www.addtoany.com/add_to/x?linkurl=https%3A%2F%2Flinuxcent.com%2Fwhat-is-ldap%2F&amp;linkname=What%20Is%20LDAP%20%E2%80%94%20and%20Why%20It%20Was%20Invented%20to%20Replace%20Something%20Worse" title="X" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Flinuxcent.com%2Fwhat-is-ldap%2F&amp;linkname=What%20Is%20LDAP%20%E2%80%94%20and%20Why%20It%20Was%20Invented%20to%20Replace%20Something%20Worse" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_copy_link" href="https://www.addtoany.com/add_to/copy_link?linkurl=https%3A%2F%2Flinuxcent.com%2Fwhat-is-ldap%2F&amp;linkname=What%20Is%20LDAP%20%E2%80%94%20and%20Why%20It%20Was%20Invented%20to%20Replace%20Something%20Worse" title="Copy Link" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Flinuxcent.com%2Fwhat-is-ldap%2F&#038;title=What%20Is%20LDAP%20%E2%80%94%20and%20Why%20It%20Was%20Invented%20to%20Replace%20Something%20Worse" data-a2a-url="https://linuxcent.com/what-is-ldap/" data-a2a-title="What Is LDAP — and Why It Was Invented to Replace Something Worse"></a></p><p>The post <a href="https://linuxcent.com/what-is-ldap/">What Is LDAP — and Why It Was Invented to Replace Something Worse</a> appeared first on <a href="https://linuxcent.com">Linuxcent</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://linuxcent.com/what-is-ldap/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1545</post-id>	</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 

Served from: linuxcent.com @ 2026-08-26 21:36:39 by W3 Total Cache
-->