Lesson 1 of 9 · 25m
The LDAP Data Model: Entries, DITs, and objectClass Reality
Learn the directory information tree as a typed object database, not a relational table, and understand what object classes really enforce.
The first LDAP outage I watched was not caused by replication, TLS, or a bad password. A well-meaning engineer imported users into ou=staff while every host was configured to search ou=people. Every account technically existed. Nobody could log in. LDAP punishes fuzzy mental models because clients do not search your intentions; they search a concrete tree with concrete filters.
An entry is a typed bag of attributes
Every entry has a distinguished name, or DN, which uniquely locates it in the directory information tree:
dn: uid=amorales,ou=people,dc=sudosecurity,dc=org
objectClass: inetOrgPerson
objectClass: posixAccount
uid: amorales
cn: Ana Morales
sn: Morales
uidNumber: 10420
gidNumber: 10420
homeDirectory: /home/amorales
loginShell: /bin/bash
mail: amorales@sudosecurity.orgThe RDN is uid=amorales; the parent is ou=people,dc=sudosecurity,dc=org. Rename the RDN and you move the entry. Move the entry badly and every group member DN, ACL reference, and application link that stores DNs may break.
objectClass is structural typing, not a label
An objectClass says which attributes an entry must and may contain. Classes can be structural, auxiliary, or abstract. In practice:
inetOrgPerson structural person identity: cn, sn, mail, uid
posixAccount auxiliary Unix login data: uidNumber, gidNumber, homeDirectory
posixGroup group of Unix member DNs through memberUid
groupOfNames LDAP group of member DNs through memberAn entry normally has exactly one structural class chain. You cannot casually bolt on a second structural class such as both inetOrgPerson and account unless schema design permits it. Use auxiliary classes for extensions.
LDAP is not a relational database
There are no joins, foreign keys, transactions across trees, or cascading deletes. A group stores member DNs, but deleting the user does not automatically remove those memberships. Multi-valued attributes are normal:
objectClass: inetOrgPerson
objectClass: posixAccount
mail: ana@example.org
mail: amorales@sudosecurity.orgEquality matching depends on the attribute's matching rule. uid=AMORALES may match case-insensitively while some binary or case-sensitive attributes do not. Never assume comparison behavior without checking schema.
Design the tree around lifecycle, not org charts
Org charts change constantly. Stable operational trees are usually flatter:
dc=sudosecurity,dc=org
├── ou=people
├── ou=groups
├── ou=services
├── ou=hosts
└── ou=policiesUse nested OUs only when they create a real administrative or replication boundary. Every extra branch becomes another search base, ACL exception, migration path, and onboarding question.
Field notes
- DNs are names, not immutable identities; use stable IDs in applications when references must survive renames.
cnis display data in most person entries; do not use it as a login identifier.- LDAP modifies individual attribute values, but clients often replace entire multi-valued attributes accidentally.
- Empty attributes generally cannot exist; remove the value instead of storing an empty string.
Was this lesson helpful?