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

我试图让本地服务器authentication到自己的openldap服务器,然后代理企业LDAP,如果用户不在本地。

  1. 本地用户工作
  2. validation到本地LDAP服务器的作品
  3. Auth到公司LDAP不起作用
  4. 当使用本地服务器时,LDAPsearch到公司工作(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 

任何人可能会发现这个线程更新; 代理设置非常缺乏openldap文档。 这基本上是48小时的反复试验发现的。

注意:我通过在/ etc / sysconfig / ldap中添加以下内容来切换回slapd.conf SLAPD_OPTIONS =“ – f /etc/openldap/slapd.conf”

在slapd文件中,您将find4个数据库; 1.用于LDAP AUTH的本地数据库(test.com)2.用于LDAP AUTH的外部数据库连接器(external.local – > corp.com)3.用于LDAP AUTH的内部数据库连接器(internal.local – > test.com)元数据库将2个连接器组合到1个数据库

匿名绑定无处不在; 使事情变得更容易

客户端现在指向本地LDAP数据库,并且可以无缝地将AUTH指向本地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"