[Date Prev][Date Next] [Chronological] [Thread] [Top]

RE: able to connect to LDAP server with perl, but not ldapsearch



Kurt D. Zeilenga pointed out it was likely the ldapsearch syntax I was
using, and he was right.
In the end, this command worked, with or without an /etc/ldap/ldap.conf.
ldapsearch -x -H ldap://localhost:389 -D
'cn=admin,dc=ncr,dc=pwgsc,dc=gc,dc=ca' -W \
-b 'dc=ncr,dc=pwgsc,dc=gc,dc=ca'
"(&(objectclass=posixAccount)(gidNumber=100))"

Thanks to all who responded.
Jeffrey Marans.


-----Original Message-----
From: Georg Klein [mailto:georg.klein@gmx.info]
Sent: Monday, January 19, 2004 4:54 PM
To: openldap-software@OpenLDAP.org
Subject: Re: able to connect to LDAP server with perl, but not
ldapsearch


On Mon, 19 Jan 2004 13:39:07 -0500
"Jeffrey Marans" <Jeffrey.Marans@pwgsc.gc.ca> wrote:

> I've installed openldap on a debian woody box and am able to query
> slapd from perl scripts and webmin, but ldapsearch returns
> ldap_sasl_interactive_bind_s: Can't contact LDAP server. I've
> configured /etc/pam_ldap.conf, /etc/nsswitch.conf, and
> /etc/libnss-ldap.conf, but getent passwd only looks at /etc/passwd.
> 
> I'm running slapd in debug mode and it doesn't see the ldapsearch
> connect attempt.
> 
> I've linked /etc/ldap/slapd.conf to /etc/ldap/ldap.conf just in case
> I'm missing something.
> 

hi,

I think your 'ldapsearch' is missing the proper configuration file,
which - on several linux-systems - is not the same as that for ldap.
On Redhat-Systems, for example, you have to configure '/etc/ldap.conf'
for the openldap-software and '/etc/openldap/ldap.conf' for ldapsearch
to work. Try a 'strace' on 'ldapsearch' and you will see which file it
will try to read.

hth
georg