Understanding Active Directory's LDAP implementation: the LDAP interface, domain controllers and the Global Catalog, ports 389/636/3268/3269, and joining Linux systems to an AD domain with realmd, SSSD, and Winbind.

So far in this series you've worked with OpenLDAP. Episode 22 introduces the other giant in the directory world: Microsoft Active Directory. You'll see that AD speaks the same LDAP language you already know — but with its own ecosystem, schema, and tooling. Then you'll learn how Linux systems join an AD domain, because in a mixed environment this is a daily reality.
Active Directory is a directory service, but not built on OpenLDAP — it's built on its own database (Jet/ESE) with its own schema and security model. What's important here: AD exposes a full LDAP interface. Any LDAP client can search, bind, and query AD as if it were any other LDAP server.
simple bind against userPrincipalName or sAMAccountName, and supports SASL NTLM and Kerberos.dc=corp,dc=example,dc=com for corp.example.com.CN=Users,DC=corp,DC=example,DC=com or an OU you create.uid is replaced by sAMAccountName and userPrincipalName.{SSHA}.ldapsearch -x -H ldap://dc01.corp.example.com \
-D "CN=Administrator,CN=Users,DC=corp,DC=example,DC=com" -W \
-b "DC=corp,DC=example,DC=com" \
"(sAMAccountName=budi)" sAMAccountName mail| Port | Purpose |
|---|---|
| 389 | LDAP (StartTLS capable) |
| 636 | LDAPS (LDAP over TLS) |
| 3268 | Global Catalog LDAP |
| 3269 | Global Catalog LDAPS |
| 88 | Kerberos |
| 445/139 | SMB, used by Winbind and join tools |
The Global Catalog listens on ports 3268/3269. Applications that must search across the whole forest use the GC, not the regular LDAP port.
CN= for containers and objects (CN=Budi,CN=Users,DC=corp,DC=example,DC=com).sAMAccountName (the short login), userPrincipalName (login@domain), mail, telephoneNumber, memberOf.ldapmodify or the AD Schema console, custom attributes can be added to user objects.The most practical difference from OpenLDAP: the attribute that applications and admins use for the username is sAMAccountName, not uid.
The modern way for Linux to join an AD domain uses realmd and sssd. The packages on Debian and Ubuntu:
sudo apt install realmd sssd sssd-tools libnss-sss libpam-sss adcli krb5-userDiscover and join:
sudo realm discover CORP.EXAMPLE.COM
sudo realm join --user=Administrator CORP.EXAMPLE.COMThe join writes an sssd.conf and a computer account in AD. Then test:
sudo realm list
getent passwd budi@corp.example.com
id budi@corp.example.comConfiguration lives in /etc/sssd/sssd.conf:
[sssd]
domains = corp.example.com
services = nss, pam
[domain/corp.example.com]
ad_domain = corp.example.com
krb5_realm = CORP.EXAMPLE.COM
realmd_tags = manages-system joined-with-adcli
cache_credentials = True
id_provider = ad
auth_provider = ad
access_provider = adThe ad provider tells SSSD to use AD directly; cache_credentials = True keeps logins working when a DC is unreachable.
The older (still widely used) path is Samba Winbind. Install winbind and set the Kerberos realm in /etc/krb5.conf:
[libdefaults]
default_realm = CORP.EXAMPLE.COM
[realms]
CORP.EXAMPLE.COM = {
kdc = dc01.corp.example.com
admin_server = dc01.corp.example.com
}Join with Samba:
sudo smbpasswd -r CORP.EXAMPLE.COM -U Administrator
sudo net ads join -U Administrator -D CORPThen configure NSS and PAM with wbinfo for lookups and pam_winbind for authentication. The difference: Winbind is older and less integrated, SSSD is the recommended modern choice, but both are production-viable.
AD as an LDAP server integrates with applications exactly as OpenLDAP did in episode 21:
userPrincipalName or sAMAccountName@corp.example.com.(&(objectClass=user)(mail=%s)).pass_filter: (&(objectClass=user)(userPrincipalName=%u)), with auth_bind = yes.ldap user federation connects to AD with the base DN and the sAMAccountName login attribute.The migration path from OpenLDAP to AD (or back) is a real project — attribute mapping, ACL translation, and application rewrites — covered more deeply in episode 28.
In this episode 22 you understood Active Directory as an LDAP ecosystem: its LDAP interface with sAMAccountName and userPrincipalName, domain controllers and the Global Catalog with ports 3268/3269, the AD schema, joining Linux with realmd/SSSD, the Winbind alternative, and application integration through the same LDAP patterns.
Key takeaways:
sAMAccountName, not uid.realmd + sssd beats Winbind for new deployments.In the next episode, episode 23, we connect the directory to other data sources: LDAP proxy & gateway patterns — back-ldap, the meta backend, and back-sql, for federating and bridging.