OpenLDAP - Add an organizational unit (OU)
by
Jeremy Canfield |
Updated: March 11 2020
| OpenLDAP articles
This assumes you have already installed OpenLDAP and configured OpenLDAP to use your domain name, such as example.com.
Create an LDIF file for the new organizational units (OU).
~]# touch /etc/openldap/slapd.d/OU.ldif
In this example, an OU named Group will be added to OpenLDAP. You can replace Groups with any other text, such as Users or myCustomOU.
cn: ou=Group,dc=example,dc=com
ou: Group
objectClass: top
objectclass: organizationalunit
Add the OU into OpenLDAP.
~]# ldapadd -x -W -D "cn=Manager,dc=example,dc=com" -f /etc/openldap/slapd.d/OU.ldif
Enter LDAP password: ******
adding new entry "ou=Group,dc=example,dc=com"
The ldapsearch command can be used to verify that the OU has been added to OpenLDAP.
Did you find this article helpful?
If so, consider buying me a coffee over at