Professional Documents
Culture Documents
UID=manoj
An entry is referenced by its distinguished
name, which is constructed by taking the name of the
entry itself (called the Relative Distinguished Name) and
concatenating the names of its ancestor entries. For
example the entry for Manoj in the above example has
an RDN of uid=manoj and a DN of
uid=manoj,ou=people,dc=aita,dc=com. A DN should
be unique in a directory tree.
LDAP provides a set of tools for searching,
adding, deleting and modifying the directory entries. The
LDAP search operation allows some portion of the
directory to be searched for entries that match some
criteria specified by a search filter. Information can be
requested from each entry matches the criteria.
Working of LDAP
LDAP directory service is based on a client-
server model. One or more LDAP servers contain the
data making up the directory information tree (DIT). The
client connects to servers and asks it a question. The
server responds with an answer and/or with a pointer to
where the client can get additional information (typically
another LDAP server).
slapd – LDAP Directory Server
# ldapsearch –x –D “cn=root,dc=aita,dc=com” –W
‘(objectclass=*)’
# ldapsearch -LLL -x -D "cn=root,dc=aita,dc=com" -W
'(objectclass=*)'
Adding additional entries with
LDAP database:
Create a LDIF file as follows:
# vi people.ldif
dn: ou=people,dc=aita,dc=com
objectclass: organizationalunit
ou: people
dn: uid=manoj,ou=people,dc=aita,dc=com
objectclass: person
objectclass: inetorgperson
sn: manu
cn: manoj
uid: manoj
userpassword: flower
After creating the file run the ldapadd
command to add the entries in LDAP database
ldapadd -x -D "cn=root,dc=aita,dc=com" -W -f
people.ldif
Enter LDAP Password:
# vi.mod.ldif
dn: uid=manoj,ou=people,dc=aita,dc=com
changetype: modify
add: mail
mail: m.mano@accelstl.com-
add: title
title: courseware
-
replace: sn
sn: mrg
After creating the LDIF file as above run the
ldapmodify command as follows:
# ldapmodify –x –D “cn=root,dc=aita,dc=com” –W –f
mod.ldif