
ローカル サーバーを独自の openldap-server に認証させ、ユーザーがローカルに見つからない場合は企業の LDAP にプロキシするようにしようとしています。
- ローカルユーザーが作業
- ローカルLDAPサーバーへの認証が機能する
- 企業LDAPへの認証が機能しない
- ローカル サーバーを使用すると、企業への LDAP 検索が機能します (おっと!?!)
ユーザー = 企業 LDAP アカウント 内部 ldap = users - internal.com 企業 ldap = people - 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"