LDAP プロキシ + nslcd を使用して認証用に別のドメインの冗長 AD ユーザー名を処理する方法

LDAP プロキシ + nslcd を使用して認証用に別のドメインの冗長 AD ユーザー名を処理する方法

LDAPをバックエンドとして使用してLDAPプロキシとして機能するUbuntuシステムがあり、それぞれ異なるドメインを持つアクティブディレクトリを持つ2つのWindowsシステム2008 r2を持つシナリオがあります。abc.comとxyz.com

2つは互いに異なり、それぞれに一意のユーザー名があります。

ただし、ユーザー名と同じように、両方の広告に同じユーザー名がある可能性があります。abc.comのtest_ad1&同じユーザー名xyz.comのtest_ad1ユーザー属性の unix 属性タブには uid/gid が異なります。

それでは、認証用に異なるADの冗長ユーザーを処理する方法は?

これまでに試したこと、つまりnslcd、pamを使用して正しいLDAPプロキシを設定すると、2つのADユーザーを別々に取得できます。 「パスワードを受け取る」私のUbuntuエージェントシステムのコマンドは、次のユーザーを示しています。

test_ad3:*:20001:666:test ad3:/home/test_ad3:/bin/bash      // this users are of ad1 (abc.com)
test_ad4:*:20002:666:test ad4:/home/test_ad4:/bin/bash      // this users are of ad1 (abc.com)
test_ad1:*:20003:666:test ad11:/home/test_ad1:/bin/bash     // this users are of ad1 (abc.com)   password at AD1 is 123@test
test_ad1:*:10010:777:test ad1:/home/test_ad1:/bin/bash      // this users are of ad2 (xyz.com)   password at AD2 is test@1234
test_ad2:*:10011:777:test ad2:/home/test_ad2:/bin/bash      // this users are of ad2 (xyz.com)

ご覧のとおり、すべてのユーザーは異なるuid / gidを持っています。つまり、ユニークです。

そのため、認証にUbuntu LDAPプロキシシステムで別のドメイン名を使用しようとしましたが、失敗しました。

1) su abc.com\\test_ad1---> auth.log shows me "No passwd entry for user test_ad1"
2) su xyz.com\\test_ad1---> auth.log shows me "No passwd entry for user test_ad1"

しかし、今試したときsu test_ad1&最初の広告(abc.com)のパスワードを入力してください。123@テスト正常にログインした後、2番目の広告(xyz.com)のパスワードを入力すると、テスト@1234同じことのためにsu test_ad1見られるよりsu:パスワードが違っても認証に失敗しました。CLIから。

他のものだと思います。test_ad1(10011:777はad2ユーザーです)直後test_ad1(20003:666はad1ユーザーです) 存在するパスワードを取得するリスト、これは逐次作業の動作によるものである可能性があります。NSCD私が間違っている場合は訂正してください。

これは私のslapd.confです。

################ LDAP MULTIPLE BACK END ##########
######## 1st AD ##########
moduleload     back_ldap
backend        ldap
database       ldap
suffix         "dc=ad2,dc=com"
uri            ldap://192.168.1.189:389/
rebind-as-user
idassert-bind bindmethod=SIMPLE binddn="CN=Administrator,CN=Users,DC=ad2,DC=com" credentials=Admin@1234
#mode=none
idassert-authzFrom "*"
access to * by * read
moduleload rwm.la
overlay rwm
rwm-map attribute uid sAMAccountName
rwm-map attribute homeDirectory unixHomeDirectory
rwm-map objectClass posixAccount person
######## 1st AD ##########

######## 2nd AD ##########
database       ldap
suffix         "dc=ad1,dc=com"
uri            ldap://192.168.1.185:389/
rebind-as-user
idassert-bind bindmethod=SIMPLE binddn="CN=Administrator,CN=Users,DC=ad1,DC=com" credentials=Admin@1234
#mode=none
idassert-authzFrom "*"
access to * by * read
overlay rwm
rwm-map attribute uid sAMAccountName
rwm-map attribute homeDirectory unixHomeDirectory
rwm-map objectClass posixAccount person

######## 2nd AD ##########

nslcd.confです。

# Mappings for Active Directory
pagesize 1000
referrals off
#nss_nested_groups yes

# Passwd
filter passwd (&(objectClass=posixAccount)(objectClass=USER)(!(objectClass=computer))(uidNumber=*))
map   passwd homeDirectory     unixHomeDirectory
map   passwd gecos             displayName
map   passwd gidNumber         primaryGroupID
map   shadow uid               sAMAccountName


# Shadow
filter shadow (&(objectClass=posixAccount)(!(objectClass=computer))(uidNumber=*))
map    shadow shadowLastChange  pwdLastSet

# Groups
filter group (&(objectClass=posixGroup)(gidNumber=*))
#map    group uniqueMember       member

# Local account for nsclcd
uid nslcd
gid openldap

# Where is the LDAP Proxy
#LDAP
uri ldap://192.168.1.186:389  
base dc=ad1,dc=com
base dc=ad2,dc=com

#Note when i change base to reverse order than user test_ad1 logon successfully with ad2 password and ad1 password fails
#base dc=ad2,dc=com
#base dc=ad1,dc=com

base group ou=Groups,dc=ad1,dc=com
base group ou=Groups,dc=ad2,dc=com


# Connect-Account of ad1
binddn cn=administrator,cn=Users,dc=ad1,dc=com
bindpw Admin@1234

# Connect-Account of ad2
binddn cn=administrator,cn=Users,dc=ad2,dc=com
bindpw Admin@1234

注: 私はフォローするこれAD 1 つの認証に使用される LDAP プロキシのドキュメントです。

私はこれに慣れておらず、これが少し混乱する可能性があることを知っています!

もしそうなら、LDAP / ADの専門家はこのタイプのシナリオを助けることができますか?

どんな助けでも大変感謝します。ありがとうございます。

ベストアンサー1

おすすめ記事