
Tengo un problema con mi servidor OpenLDAP. No puedo conectarme externamente desde el cliente, solo funciona localmente. Mi servidor OpenLDAP se ejecuta en una Raspberry Pi con Rasbian como sistema operativo.
Cuando ejecuto este ldapsearch desde un cliente:
$ ldapsearch -h ldap://ldap.fast.com -p 389 -D "dc=fast,dc=com" -x -W
Yo obtengo:ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1)
Pero cuando lo haces localmente en Raspberry todo funciona bien.
No tengo iptables configurado:
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain L (0 references)
target prot opt source destination
Chain fail2ban-ssh (0 references)
target prot opt source destination
Este es mi /etc/ldap/ldap.conf
archivo:
# LDAP Defaults
# See ldap.conf(5) for details
# This file should be world readable but not world writable.
BASE dc=fast,dc=com
URI ldap://ldap.fast.com ldap://ldap.fast.com:666
#SIZELIMIT 12
#TIMELIMIT 15
#DEREF never
# TLS certificates (needed for GnuTLS)
TLS_CACERT /etc/ssl/certs/ca-certificates.crt
TLSCipherSuite HIGH:MEDIUM:+TLSv1:!SSLv2:+SSLv3
TLSCACertificateFile /etc/ssl/certs/ldap-cert.pem
TLSCertificateFile /etc/ssl/certs/ldap-cert.pem
TLSCertificateKeyFile /etc/ldap/ldap-ssl.pem
TLSVerifyClient demand
Mi FQDN es:ldap.fast.com
Mi dominio es:rápido.com
El servidor escucha ambos puertos (389 y 636), salida de ss -tuln | grep -E '389|636'
:
tcp LISTEN 0 128 *:636 *:*
tcp LISTEN 0 128 *:389 *:*
Hacer Telnet en los puertos 389 y 636 me da esto:
Trying 192.168.1.5...
Connected to ldap.fast.com.
Escape character is '^]'.
Cualquier ayuda sería apreciada. Gracias.
Respuesta1
"-h" se usa para nombres de host, "-H" se usa para URI. Intente hacer su consulta como:
ldapsearch -H ldap://ldap.fast.com:389 -D "dc=fast,dc=com" -x -W
(el "-p" no se usa con "-H", en su lugar incluya el puerto si es necesario en el URI)