这是我的 /etc/hosts 文件:
这是我的 ldap.conf 文件:
我正在
“ldap_sasl_bind(SIMPLE):无法联系 LDAP 服务器(-1)”
当我运行此命令时:
ldapsearch -x -H "ldap://ldap.techvictus.local" -P 3 -LLL -b "dc=techvictus,dc=local"
我不认为主机名
ldap.techvictus.local
实际上是可寻址的...(即可以在IP地址中解析的主机名)。
尝试
ldap://localhost
我关注的这个链接对我来说效果很好
https://lea-linux.org/documentations/Trucs:Ldap_sasl_bind_cant_contact_LDAP_server
上述链接的想法只是确保/etc/openldap/ldap.conf中的参数具有像这样设置的参数。
TLS_CACERTDIR /etc/openldap/certs
TLS_REQCERT 从不
我很确定你现在已经弄清楚了,但请在这里为其他人留下评论。
我遇到了同样的问题,我意识到我使用的域名只是一个虚构的(假域名,例如:
marvel.comics
)。所以我将 ldap.conf
修改为 URI ldap://${IP_ADDRESS}
并且成功了。
看起来您最初是用您的 IP 地址配置 ldap.conf 的。然而,你的
/etc/hosts
对我来说似乎很奇怪。
我建议使用您系统的 IP 地址,而不是
127.0.1.1
。还可以在 IP 地址后使用 FQDN。
192.168.1.123 hulk.marvel.comics hulk
127.0.0.1 localhost
and the rest...
就我而言(Debian 12 LXC 容器),我必须安装
libldap-common
并将 TLS_REQCERT never
添加到 /etc/openldap/ldap.conf:
apt -y install ldap-utils libldap-common
echo "TLS_REQCERT never" >> /etc/ldap/ldap.conf