centos 6에서 다른 LDAP 서버에 openldap 프록시 설정

centos 6에서 다른 LDAP 서버에 openldap 프록시 설정

로컬 서버가 자체 openldap-server에 인증하도록 한 다음 사용자가 로컬에서 발견되지 않으면 회사 LDAP에 프록시를 지정하려고 합니다.

  1. 로컬 사용자의 작업
  2. 로컬 LDAP 서버에 대한 인증이 작동합니다.
  3. 기업 LDAP에 대한 인증이 작동하지 않습니다.
  4. 로컬 서버를 사용하면 회사에 대한 LDAP 검색이 작동합니다(ack!?!)

사용자 = 회사 LDAP 계정 내부 ldap = 사용자 - Internal.com 회사 ldap = 사람 - datacenter.corporate.com

참고: 회사에서는 익명 바인딩이 활성화되어 있습니다.

oot@ sssd]# ldapsearch -h 127.0.0.1 -x -b "uid=user,ou=people,dc=datacenter,dc=corporate,dc=com"
# extended LDIF
#
# LDAPv3
# base <uid=user,ou=people,dc=datacenter,dc=corporate,dc=com> with scope subtree
# filter: (objectclass=*)
# requesting: ALL
#

# user, People, datacenter.corporate.com
dn: uid=user,ou=People,dc=datacenter,dc=corporate,dc=com
uid: user
cn: 
objectClass: account
objectClass: posixAccount
objectClass: top
objectClass: shadowAccount
shadowMax: 
shadowWarning: 
loginShell: /bin/bash
uidNumber: 
gidNumber: 
homeDirectory: /home/users/user
gecos: user
shadowLastChange: 16461

# search result
search: 2
result: 0 Success

# numResponses: 2
# numEntries: 1

slap.d 설정:

#######################################################################
# database definitions
#######################################################################

database bdb
suffix "dc=internal,dc=com"
checkpoint 1024 15
rootdn "cn=adm,dc=internal,dc=com"
rootpw {SSHA}aaaaa
directory /var/lib/ldap

# Indices to maintain for this database
index objectClass eq,pres
index ou,cn,mail,surname,givenname eq,pres,sub
index uidNumber,gidNumber,loginShell eq,pres
index uid,memberUid eq,pres,sub
index nisMapName,nisMapEntry eq,pres,sub

# Replicas of this database
#replogfile /var/lib/ldap/openldap-master-replog
#replica host=ldap-1.example.com:389 starttls=critical
# bindmethod=sasl saslmech=GSSAPI
# authcId=host/[email protected]

#proxy ldap
database ldap
suffix "ou=People,dc=datacenter,dc=corp,dc=com"
uri "ldap://1.1.1.1:389/"

idassert-bind bindmethod=none

LDAP.conf:

URI ldap://127.0.0.1
BASE dc=internal,dc=com

답변1

이 스레드를 발견할 수 있는 모든 사람을 위한 업데이트; openldap 문서에는 프록시 설정이 매우 부족합니다. 이는 기본적으로 48시간의 시행착오를 통해 알아낸 것입니다.

참고: /etc/sysconfig/ldap SLAPD_OPTIONS="-f /etc/openldap/slapd.conf"에 다음을 추가하여 slapd.conf로 다시 전환했습니다.

slapd 파일에는 4개의 데이터베이스가 있습니다. 1. LDAP AUTH용 로컬 데이터베이스(test.com) 2. LDAP AUTH용 외부 데이터베이스 커넥터(external.local -> corp.com) 3. LDAP AUTH용 내부 데이터베이스 커넥터(internal.local -> test.com) 4. 2개의 커넥터를 1개의 데이터베이스로 결합한 메타 데이터베이스

모든 곳에서 익명으로 바인딩됩니다. 일을 더 쉽게 만들었습니다.

이제 클라이언트는 로컬 LDAP 데이터베이스를 가리키며 로컬 LDAP 또는 기업 LDAP에 원활하게 인증할 수 있습니다.

slapd.conf

#local database 
database        bdb
suffix  "dc=test,dc=com"
checkpoint      1024 15
rootdn  "cn=adm,dc=test,dc=com"
rootpw  {SSHA}aaa
directory       /var/lib/ldap


#Indices to maintain for this database
index objectClass                       eq,pres
index ou,cn,mail,surname,givenname      eq,pres,sub
index uidNumber,gidNumber,loginShell    eq,pres
index uid,memberUid                     eq,pres,sub
index nisMapName,nisMapEntry            eq,pres,sub

#database meta
database meta
suffix  "dc=local"
rootdn  "cn=adm,dc=local"
rootpw  {SSHA}aaa

#dir1
uri      "ldap://corporate-ldap.com/ou=external,dc=local"
lastmod       off
suffixmassage   "ou=external,dc=local" "dc=datacenter,dc=corp,dc=com"

#dir2
uri      "ldap://127.0.0.1/ou=internal,dc=local"
lastmod       off
suffixmassage   "ou=internal,dc=local" "dc=test,dc=com"

관련 정보