
OpenLDAP サーバーに問題があります。クライアントから外部に接続できず、ローカルでしか動作しません。私の OpenLDAP サーバーは、OS として 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)
しかし、ラズベリーでローカルに実行すると、すべて正常に動作します。
iptables が設定されていません:
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
私のドメインは:ファストコム
サーバーは両方のポート (389 と 636) をリッスンしており、出力は次のようになりますss -tuln | grep -E '389|636'
。
tcp LISTEN 0 128 *:636 *:*
tcp LISTEN 0 128 *:389 *:*
ポート 389 および 636 に Telnet すると、次のようになります。
Trying 192.168.1.5...
Connected to ldap.fast.com.
Escape character is '^]'.
ご協力いただければ幸いです。ありがとうございます。
答え1
「-h」はホスト名に使用され、「-H」は URI に使用されます。次のようにクエリを実行してみてください。
ldapsearch -H ldap://ldap.fast.com:389 -D "dc=fast,dc=com" -x -W
(「-p」は「-H」では使用されません。代わりに、必要に応じて URI にポートを含めます)