哪些配置错误会导致ldapsearch工作和getent工作的情况,但身份验证在SSH登录期间似乎有时会失败?
我有两台服务器查询第三台服务器以获得LDAP身份验证。所有服务器都在运行Ubuntu 18.04。
LDAP服务器(运行OpenLDAP / slapd)使用自签名证书,两个客户端服务器在/etc/ldap/ldap.conf中都有"TLS_REQCERT允许“。这两个客户端服务器也可以成功地使用ldapsearch对ldaps进行用户查询。在这两个客户端服务器上,我可以运行getent并获得预期的结果。
但是,在一台服务器上,当我通过ssh登录时,我会经历一个持续的延迟(大约30秒)。来自该服务器的/var/log/auth.log包含以下行:
pam_systemd(sshd:session): Failed to create session: Connection timed out
nss_ldap: reconnecting to LDAP server...
nss_ldap: reconnected to LDAP server ldaps://[IP address] after 1 attempt
systemd-logind: nss_ldap: could not connect to any LDAP server as [...] - Can't contact LDAP server
systemd-logind: nss_ldap: failed to bind to LDAP server ldaps://[IP address]: Can't contact LDAP server据了解,两个客户端服务器的所有相关配置都是相同的。
我试过:
sudo systemctl restart systemd-logind
sudo systemctl restart polkit-u systemd-logind显示:
nss_ldap: could not connect to any LDAP server as [...] - Can't contact
nss_ldap: failed to bind to LDAP server ldaps://[IP address]: Can't contact LDAP server
nss_ldap: reconnecting to LDAP server (sleeping 1 seconds)...在SSH的客户端,我看到了这里概述的内容:ssh连接需要很长时间才能启动,停留在“认捐:网络”
发布于 2019-01-09 20:14:12
事实证明,"apt“似乎解决了这个问题,它删除了libnss,并安装了nscd和nslcd。
发布于 2021-11-28 06:05:36
我不知道什么对我有用:
apt install libnss-ldapd
service nscd stop或从ldapi://改为ldap://
我的REHL7服务器(运行openladp)配置为ldapi://,并且RHEL7客户端通过ldapi://连接。
但是,我无法让Debian 11实例使用ldapi://。
编辑:使用ldap://代替ldapi://为我工作。
发布于 2020-11-10 17:25:23
apt install libnss-ldapd
systemctl restart systemd-logind帮我修好了
https://serverfault.com/questions/948213
复制相似问题