How do I clone an OpenLDAP database

The problem with SourceRebels’ answer is that slapcat(8) does not guarantee that the data is ordered for ldapadd(1)/ldapmodify(1). From man slapcat (from OpenLDAP 2.3) : The LDIF generated by this tool is suitable for use with slapadd(8). As the entries are in database order, not superior first order, they cannot be loaded with ldapadd(1) without … Read more

Querying Windows Active Directory server using ldapsearch from command line

The short answer is “yes”. A sample ldapsearch command to query an Active Directory server is: ldapsearch \ -x -h ldapserver.mydomain.example \ -D “mywindowsuser@mydomain.example” \ -W \ -b “cn=users,dc=mydomain,dc=com” \ -s sub “(cn=*)” cn mail sn This would connect to an AD server at hostname ldapserver.mydomain.example as user mywindowsuser@domain.example, prompt for the password on the … Read more

OpenLDAP TLS Authentification

I was following the same guide and had the same issue. It will work if you do the steps to “Tighten up ownership and permissions” listed after the offending ldapmodify command first–namely: sudo adduser openldap ssl-cert sudo chgrp ssl-cert /etc/ssl/private sudo chgrp ssl-cert /etc/ssl/private/ldap01_slapd_key.pem sudo chmod g+X /etc/ssl/private sudo chmod g+r /etc/ssl/private/ldap01_slapd_key.pem and sudo systemctl … Read more

CentOS openLDAP cert trust issues

RHEL does not in fact provide anything that can be used as a ‘certificate directory’ for CA trust purposes. For OpenSSL, a certificate directory – a ‘CApath’ – is a directory containing individual certificate files (in PEM format or OpenSSL’s extended ‘trusted certificate’ format), with names in a specific format based on a hash of … Read more