ldapsearch는 결과를 반환하지만 getent는 결과를 반환하지 않습니다.

ldapsearch는 결과를 반환하지만 getent는 결과를 반환하지 않습니다.

새로운 CentOS 7 서버를 설정 중이고 LDAP 인증을 설정해야 합니다. 즉, 다른 GNU/Linux 서버에 사용하는 사용자를 인증하는 서버가 이미 존재합니다.

예를 들어 Windows에서는 nltest /dclist:X.Y. 올바른지 확인할 수 있는 DC 서버 목록이 반환됩니다.

ldapsearchCentOS 7 서버를 사용하여 이러한 DC 서버에 대한 연결을 테스트하면 작동합니다.

ldapsearch -H ldap://<DCSERVER> -D <user>@X.Y -w

출력은 DN 정보를 포함한 긴 정보 목록입니다.

그러나 을 사용할 때 getent passwd출력이 없으며 /var/log/messages에 오류가 표시됩니다.

Nov 24 16:09:37 XXXXXXXX nslcd[22440]: [16e9e8] <passwd(all)> ldap_result() failed: Operations error: 000004DC: LdapErr: DSID-0C09072B, comment: In order to perform this operation a successful bind must be completed on the connection., data 0, v2580

getent password다른 CentOS 6 서버에서는 잘 작동하지만 BeyondTrust를 사용하고 있습니다. 이전하고 싶은데 설치 당시 관리자가 아니었습니다.

관련 구성 파일:

/etc/openldap/ldap.conf다음을 포함합니다:

#
# LDAP Defaults
#

# See ldap.conf(5) for details
# This file should be world readable but not world writable.

#BASE   dc=example,dc=com
#URI    ldap://ldap.example.com ldap://ldap-master.example.com:666

#SIZELIMIT      12
#TIMELIMIT      15
#DEREF          never

TLS_CACERTDIR /etc/pki/tls/certs

# Turning this off breaks GSSAPI used with krb5 when rdns = false
SASL_NOCANON    on
URI ldap://<DCSERVER>
BASE DC=X,DC=Y

/etc/nsswitch.conf내용:

#
# /etc/nsswitch.conf
#
# An example Name Service Switch config file. This file should be
# sorted with the most-used services at the beginning.
#
# The entry '[NOTFOUND=return]' means that the search for an
# entry should stop if the search in the previous entry turned
# up nothing. Note that if the search failed due to some other reason
# (like no NIS server responding) then the search continues with the
# next entry.
#
# Valid entries include:
#
#       nisplus                 Use NIS+ (NIS version 3)
#       nis                     Use NIS (NIS version 2), also called YP
#       dns                     Use DNS (Domain Name Service)
#       files                   Use the local files
#       db                      Use the local database (.db) files
#       compat                  Use NIS on compat mode
#       hesiod                  Use Hesiod for user lookups
#       [NOTFOUND=return]       Stop searching if not found so far
#

# To use db, put the "db" in front of "files" for entries you want to be
# looked up first in the databases
#
# Example:
#passwd:    db files nisplus nis
#shadow:    db files nisplus nis
#group:     db files nisplus nis

passwd:     files ldap
shadow:     files ldap
group:      files ldap
#initgroups: files

#hosts:     db files nisplus nis dns
hosts:      files dns

# Example - obey only what nisplus tells us...
#services:   nisplus [NOTFOUND=return] files
#networks:   nisplus [NOTFOUND=return] files
#protocols:  nisplus [NOTFOUND=return] files
#rpc:        nisplus [NOTFOUND=return] files
#ethers:     nisplus [NOTFOUND=return] files
#netmasks:   nisplus [NOTFOUND=return] files

bootparams: nisplus [NOTFOUND=return] files

ethers:     files
netmasks:   files
networks:   files
protocols:  files
rpc:        files
services:   files sss

netgroup:   files sss

publickey:  nisplus

automount:  files sss
aliases:    files nisplus

/etc/nslcd.conf다음을 포함합니다:

# This is the configuration file for the LDAP nameservice
# switch library's nslcd daemon. It configures the mapping
# between NSS names (see /etc/nsswitch.conf) and LDAP
# information in the directory.
# See the manual page nslcd.conf(5) for more information.

# The user and group nslcd should run as.
uid nslcd
gid ldap

# The uri pointing to the LDAP server to use for name lookups.
# Multiple entries may be specified. The address that is used
# here should be resolvable without using LDAP (obviously).
#uri ldap://127.0.0.1/
#uri ldaps://127.0.0.1/
#uri ldapi://%2fvar%2frun%2fldapi_sock/
# Note: %2f encodes the '/' used as directory separator
uri ldap://<DCSERVER>

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

# The distinguished name of the search base.
base DC=X,DC=Y

# The distinguished name to bind to the server with.
# Optional: default is to bind anonymously.
#binddn cn=proxyuser,dc=example,dc=com

도움을 주셔서 미리 감사드립니다.

답변1

불일치가 있습니다. sssd 로그를 확인하면 sssd 데몬을 사용하고 있는 것입니다. 하지만 그런 다음 파일에서 구성해야 합니다.

/etc/sssd/sssd.conf

/etc/nslcd.conf에는 없습니다(pam-ldapd 데몬에 적합).

게다가:

  1. sssd.conf와 nslcd.conf의 구문은 매우 다릅니다.
  2. /etc/nsswitch.conf에서 sssd 데몬은 'sss' 키('ldap' 아님)로 참조됩니다.

답변2

이 문제를 완전히 해결하지는 못했습니다.

그러나 조사 결과 /var/log/sssd/sssd_DOMAIN.logSSS가 작동하지만 잘못 지정된 DN에 문제가 있는 것으로 나타났습니다.

(Tue Nov 25 16:21:16 2014) [sssd[be[LDI.LAN]]] [sdap_process_result] (0x2000): Trace: ldap_result found nothing!
(Tue Nov 25 16:21:16 2014) [sssd[be[LDI.LAN]]] [sdap_process_result] (0x2000): Trace: sh[0x7fc9553ddde0], connected[1], ops[0x7fc9553ed2c0], ldap[0x7fc9553d0cb0]
(Tue Nov 25 16:21:16 2014) [sssd[be[LDI.LAN]]] [sdap_process_message] (0x4000): Message type: [LDAP_RES_SEARCH_RESULT]
(Tue Nov 25 16:21:16 2014) [sssd[be[LDI.LAN]]] [sdap_get_generic_ext_done] (0x0400): Search result: Operations error(1), 000004DC: LdapErr: DSID-0C090724, comment: In order to perform this operation a successful bind must be completed on the connection., data 0, v23f0

결국 저는 Beyond Trust의 오픈소스 PBIS를 사용하기로 결정했습니다. 몇 분 안에 일했습니다.

http://www.beyondtrust.com/Resources/OpenSourceDocumentation/

관련 정보