7 Adding entries to LDAP

At this point, the LDAP tree only has the organization and the LDAP administrator. We need to some additional entries for it become useful. Recall that we already know how to define entries in section 5.

Create a single text file with the last four entry definitions (group, people, newbie as a group and newbie as a user) concatenated. Make sure you leave at least one blank line between the entries. You can create this file anywhere, but it is conventional to create it as “/var/tmp/initial.ldif”.

Then, execute the following commands:

/etc/init.d/slapd stop # stop the server for off-line changes  
slapadd -c -v -l /var/tmp/initial.ldif # add to the LDAP tree  
/etc/init.d/slapd start # restart the server  
  

This adds the entries into the LDAP tree.

To confirm that we have all the entries, use the following command:

ldapsearch -x