FreeKB - OpenLDAP Add an organizational unit (OU)
OpenLDAP - Add an organizational unit (OU)

This assumes you have already installed OpenLDAP and configured OpenLDAP to use your domain name, such as


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.

Add a Comment

We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.

Please enter 194a2 in the box below so that we can be sure you are a human.


Web design by yours truely - me, myself, and I   |   |