可以在本地连接到我的OpenLDAP服务器,但不能在外部连接

我的OpenLDAP服务器有问题。 我不能从客户端连接到它,它只能在本地工作。 我的OpenLDAP服务器运行在与Rasbian作为操作系统的Raspberry Pi上。

当我从客户端运行这个ldapsearch时:

$ ldapsearch -h ldap://ldap.fast.com -p 389 -D "dc=fast,dc=com" -x -W 

我得到: ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1)

但是,什么时候在树莓本地一切工作正常。

我没有configurationiptables:

 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 

这是我的/etc/ldap/ldap.conf文件:

 # 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 

我的FQDN是: ldap.fast.com

我的域名是: fast.com

服务器正在侦听两个端口(389和636),从ss -tuln | grep -E '389|636'输出 ss -tuln | grep -E '389|636'

 tcp LISTEN 0 128 *:636 *:* tcp LISTEN 0 128 *:389 *:* 

Telnet到端口389和636给我这个:

 Trying 192.168.1.5... Connected to ldap.fast.com. Escape character is '^]'. 

任何帮助,将不胜感激。 谢谢。

“-h”用于主机名,“-H”用于URI。 尝试做你的查询为:

 ldapsearch -H ldap://ldap.fast.com:389 -D "dc=fast,dc=com" -x -W 

(“-p”不是与“-H”一起使用,而是在URI中包含端口)