I've installed LDAP on an Ubuntu 16.04 machine, using this command:
sudo apt install slapd ldap-utils
This is my config file /etc/ldap/ldap.conf
#
# LDAP Defaults
#
# See ldap.conf(5) for details
# This file should be world readable but not world writable.
BASE dc=domain,dc=local
URI ldap://domain.local:389
#SIZELIMIT 12
#TIMELIMIT 15
#DEREF never
# TLS certificates (needed for GnuTLS)
#TLS_CACERT /etc/ssl/certs/ca-certificates.crt
I've checked status of LDAP, it's running, and I don't have any firewall running at all on the server in question:
However, when I run ldapsearch -x
it tells me:
ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1)
Here is the debug output:
ldap_create
ldap_sasl_bind
ldap_send_initial_request
ldap_new_connection 1 1 0
ldap_int_open_connection
ldap_connect_to_host: TCP domain.local:389
ldap_new_socket: 4
ldap_prepare_socket: 4
ldap_connect_to_host: Trying 192.168.9.74:389
ldap_pvt_connect: fd: 4 tm: -1 async: 0
attempting to connect:
connect errno: 111
ldap_close_socket: 4
ldap_err2string
ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1)
Here is my hosts file, and if I ping that domain it returns the IP:
127.0.0.1 localhost
192.168.9.74 domain.local
Best Answer
ldapsearch
simply cannot open a TCP connection to 192.168.9.74 port 389.There could be many reasons for that (excluding the ones you already excluded in your question):
netstat -tulpn
)