ldap_sasl_bind(SIMPLE): Can't contact LDAP server(-1)
Asked Answered
M

4

6

This is my /etc/hosts file:

This is my /etc/hosts file:

This is my ldap.conf file:

This is my ldap.conf file:

I am getting

"ldap_sasl_bind(SIMPLE): Can't contact LDAP server(-1)"

when I run this command:

ldapsearch -x -H "ldap://ldap.techvictus.local" -P 3 -LLL -b "dc=techvictus,dc=local"
Mullis answered 30/1, 2016 at 7:15 Comment(2)
Welcome to Stack Overflow. It is better to paste the actual text of the files into the question, rather than use an image. You can add them using the edit button.Tisbe
thanks, will remember it next time (rookie here :) )...Mullis
D
6

I don't think the hostname ldap.techvictus.local is actually addressable... (i.e. a hostname that can be resolved in an IP address).

Try ldap://localhost

Dreadnought answered 30/1, 2016 at 10:55 Comment(3)
yes, its working with ldap://localhost. Thanks, but that's only for the server right, what if we want to integrate this LDAP server with say OVD then how will that communication take place?Mullis
Well, you should indicate a hostname that is registered in DNS and can be contacted from the network.Dreadnought
Thank you, I have fixed this problem after updated hostname and fqdn in /etc/hosts and /etc/ldap/ldap.conf files.Rhumb
B
5

I had followed this link is working fine for me

https://lea-linux.org/documentations/Trucs:Ldap_sasl_bind_cant_contact_LDAP_server

The idea for above link just make sure the parameter in the /etc/openldap/ldap.conf has paramters are setting like this.

TLS_CACERTDIR /etc/openldap/certs

TLS_REQCERT never

Boding answered 31/1, 2023 at 3:13 Comment(1)
I had this entries, But there was some alignment issue in the ldap.conf file. Once the alignment and the indenting are sorted after the restart of the LDAP services It worked for me.Genseric
G
2

In my case (Debian 12 LXC container) I had to install libldap-common and add TLS_REQCERT never to /etc/ldap/ldap.conf:

apt -y install ldap-utils libldap-common
echo "TLS_REQCERT never" >> /etc/ldap/ldap.conf
Gratulate answered 23/5, 2024 at 15:9 Comment(0)
O
1

I'm pretty sure you've figured it out by now but leaving a comment here for others.

I was having the same issue and I realized that the domain name I was using was just a made-up (fake domain name like: marvel.comics). So I modified ldap.conf to have URI ldap://${IP_ADDRESS} and it worked.

It seems like you originally configured your ldap.conf with your IP address. However, your /etc/hosts seems odd to me.

I recommend using your system's IP address rather than 127.0.1.1. Also use FQDN after the IP address.

192.168.1.123 hulk.marvel.comics hulk
127.0.0.1 localhost

and the rest...
Offing answered 7/10, 2020 at 23:50 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.