nss_ldap이 LDAP 서버에 바인딩하지 못했습니다.

nss_ldap이 LDAP 서버에 바인딩하지 못했습니다.

LDAP 서버에 연결하고 특정 그룹의 사용자를 허용하도록 nss_ldap을 사용하여 LDAP 클라이언트(ubuntu 20.04)를 구성했습니다. 모든 것이 제대로 작동하는 것 같습니다. 클라이언트는 LDAP 서버에 액세스할 수 있고 LDAP 사용자는 클라이언트 시스템에 액세스할 수 있습니다. 그러나 클라이언트가 LDAP 서버에 연결할 때 다음과 같은 오류 메시지가 나타납니다.

systemd-logind: nss_ldap: failed to bind to LDAP server ldap://[IP address]: Can't contact LDAP server
systemd-logind: nss_ldap: reconnecting to LDAP server...
systemd-logind: nss_ldap: could not connect to any LDAP server as cn=admin,dc=example,dc=com - Can't contact LDAP server
systemd-logind: nss_ldap: could not search LDAP server - Server is unavailable

내 구성 파일은 다음과 같습니다.

/etc/ldap.conf 해당 매개변수(nss_initgroups_ignoreusers)와 관련된 내용이 자동 생성됩니다.

# The distinguished name of the search base.
base dc=example,dc=com

# Another way to specify your LDAP server is to provide an
uri ldap://[IP address]

# The LDAP version to use (defaults to 3
# if supported by client library)
ldap_version 3

# The distinguished name to bind to the server with
# if the effective user ID is root. Password is
# stored in /etc/ldap.secret (mode 600)
rootbinddn cn=admin,dc=example,dc=com

# Do not hash the password at all; presume
# the directory server will do it, if
# necessary. This is the default.
pam_password md5

nss_initgroups_ignoreusers _apt,backup,bin,clamav,daemon,fwupd-refresh,games,gnats,irc,landscape,list,lp,lxd,mail,man,messagebus,mysql,news,pollinate,proxy,root,sshd,sync,sys,syslog,systemd-coredump,systemd-network,systemd-resolve,systemd-timesync,tcpdump,tss,uucp,uuidd,www-data

/etc/ldap.secret--> 비밀번호를 포함합니다.

/etc/nsswitch.conf

passwd:         files ldap systemd
group:          files ldap systemd
shadow:         files ldap
gshadow:        files

hosts:          files dns
networks:       files

protocols:      db files
services:       db files
ethers:         db files
rpc:            db files

netgroup:       nis

/etc/pam.d/common-session

# here are the per-package modules (the "Primary" block)
session [default=1]                     pam_permit.so
# here's the fallback if no module succeeds
session requisite                       pam_deny.so
# prime the stack with a positive return value if there isn't one already;
# this avoids us returning an error just because nothing sets a success code
# since the modules above will each just jump around
session required                        pam_permit.so
# The pam_umask module will set the umask according to the system default in
# /etc/login.defs and user settings, solving the problem of different
# umask settings with different shells, display managers, remote sessions etc.
# See "man pam_umask".
session optional                        pam_umask.so
# and here are more per-package modules (the "Additional" block)
session required        pam_unix.so
session optional                        pam_ldap.so
session optional        pam_systemd.so
session required    pam_mkhomedir.so skel=/etc/skel umask=0022

/etc/security/access.conf

added this line [ -:ALL EXCEPT root khloud (ldap-group) (admin) ubuntu:ALL EXCEPT LOCAL ]

/etc/pam.d/sshd--> 다음 줄의 주석을 해제하세요.

 account  required     pam_access.so

참고: ldapsearch를 통해서도 연결을 테스트했는데 작동했습니다.

nsswitch.conf 파일을 변경하거나 nss_ldap 클라이언트를 다시 설치하려고 했지만 모든 것이 제대로 작동하는 동안에도 여전히 동일한 오류가 발생합니다.

관련 정보