在 centos 6 上设置 openldap 代理到另一个 LDAP 服务器

在 centos 6 上设置 openldap 代理到另一个 LDAP 服务器

我正在尝试让本地服务器对其自己的 openldap 服务器进行身份验证,然后如果在本地找不到用户,则代理到企业 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配置文件

#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"

相关内容