After installing OpenLDAP, we are ready to create some nodes. When comparing to a relational database, we could compare nodes to a table where we store our records. Of course they are not the same, but this comparison is made so you can have a grasp of what a node is.
We want two nodes:
Groups node
People node
There is no native application or shell. Instead, Openldap comes with a few executables you can use to perform your actions. You feed these executables with files containing the data you want to add. So let's get to it.
Make a file named add_nodes.ldif in your favorite text editor and add the following lines.
dn: ou=people,dc=test,dc=com
objectClass: organizationalUnit
ou: People
dn: ou=groups,dc=test,dc=com
objectClass: organizationalUnit
ou: Groups
To add these nodes, simply run the following command and give the admin password (that you chose during slapd setup) when prompted:
Our base is dc=test,dc=com and with this we have just added people and groups nodes.
Enabling MemberOf
In order to easily and efficiently do queries that enables you to see which users that are part of which groups, we need to set up the feature in ldap that allows us to do this.
Every group created before this module is enabled has to be deleted and remade, in order for these changes to take effect. LDAP assigns a member attribute, behind the scenes, to existing users, when creating a group.