OpenLDAP: how do you operate an LDAP directory safely?
Understand slapd, directory entries, cn=config, TLS, ACLs, replication, and a practical way to diagnose common integration failures.
OpenLDAP is an open-source software suite that implements LDAP directory services. Its main server, slapd, stores directory entries—such as users, groups, hosts, and application settings—and handles LDAPv3 client requests. LDAP is a protocol; installing OpenLDAP does not automatically create an account-management system or define application permissions.
This overview follows the OpenLDAP Software 2.6 Administrator’s Guide published January 28, 2026 and checked November 19, 2026. Distribution packages may use different paths and defaults; consult the documentation for the installed package.
Directory versus general database
A directory is designed for searching and browsing attribute-based entries, with frequent lookups and comparatively simple updates. An LDAP entry has attributes, a unique Distinguished Name (DN), and an objectClass schema that defines required and optional attributes and value types. A database backend stores entries; slapd routes requests to the database whose suffix covers the requested DN. OpenLDAP 2.6 includes MDB/LMDB as its local database backend.
A directory can fit shared identity or configuration data used by multiple applications. If an application mainly needs complex multi-table transactions, rollback, or frequent multi-record updates, evaluate a relational database instead. Choose a directory when its search, sharing, and update model fits the data.
slapd, cn=config, and access control
OpenLDAP 2.6 uses the dynamic LDAP configuration database cn=config. Although the older slapd.conf format remains documented, the 2.6 guide marks it deprecated for future removal. Manage configuration through LDAP operations and do not directly edit the live LDIF files for cn=config. Restrict who can read or change this configuration and keep a recoverable backup.
Applications receive read or write rights according to their bind identity and server ACLs. ACL rules are order-sensitive. The guide warns that if no ACL is specified, a default frontend rule can allow read access to everyone, including anonymous users. Do not assume package defaults: inspect the effective global and database ACLs, especially for password hashes and sensitive attributes.
Protect connections and plan integration
LDAP simple bind does not encrypt a password by itself. Use a verified TLS channel, such as StartTLS or an LDAPS connection, and validate the certificate chain and host name. Do not fix certificate errors by disabling verification.
A practical integration sequence is:
Define entries, schema, identifiers, and attributes the application needs.
Align the base DN with the database suffix and intended directory subtree.
Give the service account only the needed access to entries and attributes.
Configure TLS and a suitable bind method.
Test a representative base, scope, filter, and attribute list with the service account.
Set reasonable size/time limits and avoid retaining sensitive debug logs longer than needed.
This is a planning outline, not a universal command recipe. Validate against the installed package in a test instance before changing production.
Replication and troubleshooting
With syncrepl, replication is configured on the consumer. The consumer connects to a provider, loads initial directory content, then polls for changes or receives updates. Read-only consumers can support read scaling or recovery. Multi-provider writes are possible but need deliberate conflict, recovery, and client-routing design. Replication is not a backup; protect and test backups of both directory data and cn=config.
Common symptoms point to different layers:
Connection failure: check DNS, address, port, firewall, and TLS certificate name.
Bind failure: check DN, password/SASL settings, TLS requirements, and account state.
Empty search: check base DN, scope, filter, objectClass, and suffix routing.
Hidden attribute: inspect the applicable ACL and evaluation order.
Stale replica: check provider connectivity, replication credentials, search base/filter, and status.
Broad access lost after ACL change: restore the intended rule order from a known configuration backup; do not add an unrestricted allow-all rule.
Sources
[OpenLDAP Software 2.6 Administrator’s Guide](https://openldap.org/doc/admin26/)
[Introduction to OpenLDAP Directory Services](https://openldap.org/doc/admin26/intro.html)
[Configuring slapd](https://www.openldap.org/doc/admin26/slapdconf2.html)
[Access Control](https://www.openldap.org/doc/admin26/access-control.html)
[Replication](https://openldap.org/doc/admin26/replication.html)