FreeKB - Search OpenLDAP (ldapsearch)
Search OpenLDAP (ldapsearch)

Home > Search


The ldapsearch command can be used to search for OUs, People, and Groups in an OpenLDAP domain. In this example, entries in the example.com LDAP domain will be returned. The -x option means to use basic authentication instead of SASL.

ldapsearch -x -b dc=example,dc=com

 

Following is an example of what could be returned by the ldapsearch command.

dn: uid=JohnDoe,ou=People,dc=example,dc=com
uid: JohnDoe
cn: JohnDoe
sn: JohnDoe
mail: JohnDoe@example.com
objectClass: person
objectClass: organizationalPerson
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: top
objectClass: shadowAccount
userPassword: {crypx}asldfjalkfjaslkfavkjalkalkvjalkvjalfjadofiasoifjelemlaemlakemla
shadowLastChange: 17483
shadowMin: 0
shadowMax: 99999
shadowWarning: 7
loginShell: /bin/bash
uidNumber: 1001
gidNumber: 1001
homeDirectory: /home/JohnDoe
gecos: JohnDoe

dn: cn=admins,ou=Group,dc=example,dc=com
objectClass: PosixGroup
objectClass: top
cn: admins
userPassword: {crypt}x
gidNumber: 1003
memberUid: JohnDoe

 



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter 06ca0 in the box below so that we can be sure you are a human.




Comments