- So, What's This LDAP Stuff All About?
- Getting Started with Linux Server Software and Good Housekeeping
- Installing an LDAP Server in Ubuntu Linux
- Is the LDAP Server Running?
- Reconfigure the OpenLDAP Server
- Getting Comfortable with LDAP-Starting and Stopping the Server
- Using ldapsearch to Verify Correct Server Operation
- Populating the LDAP Directory
- Learning One new Thing Each Day
- Conclusion
Populating the LDAP Directory
To populate the LDAP directory, you must create a file that contains at least two entries: a top-level record and an administrative record. Listing 1 illustrates a simple example that conforms to our configuration.
dn: dc=localdomain,dc=mycompany,dc=org objectclass: dcObject objectclass: organization o: Example company dc: localdomain dn: cn=admin,dc=localdomain,dc=mycompany,dc=org objectclass: organizationalRole cn: admin
Listing 1 An LDIF file
If you create this file on the Linux system, you can then load it into the directory by typing the following command:
ldapadd -x -D "cn=admin,dc=localdomain,dc=mycompany,dc=org" -W -f init.ldif
To verify that the directory now contains the above entries, try running a search:
ldapsearch –x –b 'dc=localdomain,dc=mycompany,dc=org' '(objectclass='*')'
The above command should return something like that illustrated in Figure 10.
Figure 10 A populated LDAP database
As you can see, Figure 10 indicates that our data now resides inside the directory. You've covered a lot of ground and your directory is now running and populated with a tiny amount of data. One next step would to create another .ldif file that contains more data to load into the directory.