What are the other alternative to test a LDAP connection on linux machine

6,360

If I were you I would try these:

  1. Find suitable ldapsearch binary, and copy then run it on that system.
  2. make a perl/python script which does the same like the code below:

#

#!/bin/python
import ldap
try:
    l = ldap.open("x.x.x.x")
    # put the ldapserver address up there

    l.protocol_version = ldap.VERSION3  

    username = "cn=Manager, o=domain.com"
    # user dn above
    password  = "secret"
    # set the password

    l.simple_bind(username, password)
except ldap.LDAPError, e:
    print e
    # handle error
Share:
6,360

Related videos on Youtube

maihabunash
Author by

maihabunash

I am 17 years old and love to develop

Updated on November 28, 2022

Comments

  • maihabunash
    maihabunash over 1 year

    I have Linux machine, Redhat 5.8, that gets data via LDAP. For an unclear reason, I can’t get the data via LDAP. I see that from /var/log/messages and /var/log/secure the problem is that the ldapsearch tool is not installed on my Linux machine, and I can't find the suitable version.

    Is there some other alternative to test the LDAP connection?

    my ldap.conf

      more /etc/ldap.conf
    
      logdir /var/log/ldap
      debug 0
      referrals no
      deref never
      nss_getgrent_skipmembers yes
      host server.apple.com
      base DC=apple,DC=com
      uri ldap://server.apple.com/
    
  • maihabunash
    maihabunash almost 9 years
    I run it and I not get any outout,?
  • Mehdi Sarmadi
    Mehdi Sarmadi almost 9 years
    I found your other post, have you tried the RPM which I've addressed there?