Building an LDAP Server on Linux, Part 3 - Page 3
Adding Users
Ok, now we're rolling. Let's add some actual users, with a users.ldif file:
#Tux Entry
# ldapadd -x -D "cn=Manager,dc=carlasworld,dc=net" -W -f users.ldif
# ldapsearch -x -b 'dc=carlasworld,dc=net' '(objectclass=*)'
# extended LDIF
dn: cn=Tux P Tuxedo,dc=carlasworld,dc=net
cn: Tux P Tuxedo
cn: Tux Tuxedo
objectClass: person
sn: Tuxedo
Enter LDAP Password:
adding new entry "cn=Tux P Tuxedo,dc=carlasworld,dc=net"
#
# LDAPv3
# base
# filter: (objectclass=*)
# requesting: ALL
#
# carlasworld.net
dn: dc=carlasworld,dc=net
objectClass: top
objectClass: dcObject
objectClass: organization
o: Tuxcomputing, Inc.
# Tux P Tuxedo, carlasworld.net
dn: cn=Tux P Tuxedo,dc=carlasworld,dc=net
cn: Tux P Tuxedo
cn: Tux Tuxedo
objectClass: person
sn: Tuxedo
Hurrah! It works, it works! Note that you cannot append new entries to your .ldif file, as it must contain only new entries. If ldapadd finds any existing entries, it will stop and not process any more entries.
The Debian Difference
If you use apt-get to install OpenLDAP, dpkg will automatically configure it and set up the root domain, company, and the authorized LDAP admin and password. You can also create another LDAP admin/password combo in slapd.conf, as we did above, and use either one.

