
我正在遷移自libpam LDAP到libpam ldapd。我在從 LDAP 收集輔助組時遇到一些問題。
在libpam LDAP,我的文件裡有這個/etc/ldap.conf
:
nss_schema rfc2307bis nss_base_passwd ou=People,ou=CITIUS,dc=inv,dc=usc,dc=es nss_base_shadow ou=People,ou=CITIUS,dc=inv,dc=usc,dc=es nss_base_group ou=群組,ou=CITIUS,dc=inv,dc=usc,dc=es nss_map_attribute uniqueMember 成員
映射之所以存在,是因為我使用群組groupOfNames
而不是groupOfUniqueNames
LDAP 類,因此命名成員的屬性被命名member
為uniqueMember
.
現在,我想使用同樣的方法libpam ldapd但我無法讓它發揮作用。這是我的相關部分/etc/nslcd.conf
:
基本密碼 ou=People,ou=CITIUS,dc=inv,dc=usc,dc=es 基礎陰影 ou=People,ou=CITIUS,dc=inv,dc=usc,dc=es 基本組 ou=組,ou=CITIUS,dc=inv,dc=usc,dc=es 映射組 uniqueMember 成員
這是當使用者通過身份驗證時 nslcd 的偵錯輸出:
nslcd:[8b4567]調試:來自 pid=12090 uid=0 gid=0 的連接 nslcd:[8b4567]調試:nslcd_passwd_byuid(4004) nslcd:[8b4567]調試:myldap_search(base =“ou = People,ou = CITIUS,dc = inv,dc = usc,dc = es”,filter =“(&(objectClass = posixAccount)(uidNumber = 4004))” ) nslcd: [8b4567] 調試: ldap_initialize(ldap://172.16.54.31/) nslcd:[8b4567]調試:ldap_set_rebind_proc() nslcd:[8b4567]調試:ldap_set_option(LDAP_OPT_PROTOCOL_VERSION,3) nslcd:[8b4567]調試:ldap_set_option(LDAP_OPT_DEREF,0) nslcd:[8b4567]調試:ldap_set_option(LDAP_OPT_TIMELIMIT,10) nslcd:[8b4567]調試:ldap_set_option(LDAP_OPT_TIMEOUT,10) nslcd:[8b4567]調試:ldap_set_option(LDAP_OPT_NETWORK_TIMEOUT,10) nslcd:[8b4567]調試:ldap_set_option(LDAP_OPT_REFERRALS,LDAP_OPT_ON) nslcd:[8b4567]調試:ldap_set_option(LDAP_OPT_RESTART,LDAP_OPT_ON) nslcd: [8b4567] 偵錯: ldap_simple_bind_s("uid=ubuntu,ou=Applications,ou=CITIUS,dc=inv,dc=usc,dc=es","*****") (uri="ldap:/ /172.16.54.31/") nslcd: [8b4567] 連接到 LDAP 伺服器 ldap://172.16.54.31/ nslcd: [8b4567] 偵錯: ldap_result(): 結果結束 nslcd: [7b23c6] 調試: 來自 pid=15906 uid=0 gid=2000 的連接 nslcd: [7b23c6] 調試: nslcd_pam_authc("jorge.suarez","","su","***") nslcd:[7b23c6]調試:myldap_search(base =“ou = People,ou = CITIUS,dc = inv,dc = usc,dc = es”,filter =“(&(objectClass = posixAccount)(uid = jorge.suarez) )”) nslcd: [7b23c6] 偵錯: ldap_initialize(ldap://172.16.54.31/) nslcd: [7b23c6] 調試: ldap_set_rebind_proc() nslcd: [7b23c6] 調試: ldap_set_option(LDAP_OPT_PROTOCOL_VERSION,3) nslcd: [7b23c6] 調試: ldap_set_option(LDAP_OPT_DEREF,0) nslcd:[7b23c6]調試:ldap_set_option(LDAP_OPT_TIMELIMIT,10) nslcd:[7b23c6]調試:ldap_set_option(LDAP_OPT_TIMEOUT,10) nslcd:[7b23c6]調試:ldap_set_option(LDAP_OPT_NETWORK_TIMEOUT,10) nslcd:[7b23c6]調試:ldap_set_option(LDAP_OPT_REFERRALS,LDAP_OPT_ON) nslcd:[7b23c6]調試:ldap_set_option(LDAP_OPT_RESTART,LDAP_OPT_ON) nslcd: [7b23c6] 偵錯: ldap_simple_bind_s("uid=ubuntu,ou=Applications,ou=CITIUS,dc=inv,dc=usc,dc=es","*****") (uri="ldap:/ /172.16.54.31/") nslcd: [7b23c6] 連接到 LDAP 伺服器 ldap://172.16.54.31/ nslcd: [7b23c6] 偵錯: ldap_initialize(ldap://172.16.54.31/) nslcd: [7b23c6] 調試: ldap_set_rebind_proc() nslcd: [7b23c6] 調試: ldap_set_option(LDAP_OPT_PROTOCOL_VERSION,3) nslcd: [7b23c6] 調試: ldap_set_option(LDAP_OPT_DEREF,0) nslcd:[7b23c6]調試:ldap_set_option(LDAP_OPT_TIMELIMIT,10) nslcd:[7b23c6]調試:ldap_set_option(LDAP_OPT_TIMEOUT,10) nslcd:[7b23c6]調試:ldap_set_option(LDAP_OPT_NETWORK_TIMEOUT,10) nslcd:[7b23c6]調試:ldap_set_option(LDAP_OPT_REFERRALS,LDAP_OPT_ON) nslcd:[7b23c6]調試:ldap_set_option(LDAP_OPT_RESTART,LDAP_OPT_ON) nslcd: [7b23c6] 偵錯: ldap_simple_bind_s("uid=jorge.suarez,ou=People,ou=CITIUS,dc=inv,dc=usc,dc=es","*****") (uri="ldap ://172.16.54.31/”) nslcd: [7b23c6] 連接到 LDAP 伺服器 ldap://172.16.54.31/ nslcd:[7b23c6]調試:myldap_search(base =“uid = jorge.suarez,ou = People,ou = CITIUS,dc = inv,dc = usc,dc = es”,filter =“(objectClass = posixAccount)”) nslcd: [7b23c6] 調試: ldap_unbind() nslcd: [3c9869] 調試: 來自 pid=15906 uid=0 gid=2000 的連接 nslcd: [3c9869] 調試: nslcd_pam_sess_o("jorge.suarez","uid=jorge.suarez,ou=People,ou=CITIUS,dc=inv,dc=usc,dc=es","su","/dev=CITIUS,dc=inv,dc=usc,dc=es","su","/dev=CITIUS,dc=inv,dc=usc,dc=es","su","/dev=CITIUS, /pts/7","","豪爾赫.蘇亞雷斯")
在我看來,它甚至不會嘗試尋找群體。我做錯了什麼?我在 上看不到任何與我的問題相關的信息文件。我可能不明白該map
選項是如何工作的。
答案1
我相信該map group
參數需要與相應的參數關聯filter group
。以下是我如何使用它連接到 Active Directory:
filter passwd (&(objectClass=user)(memberOf:1.2.840.113556.1.4.1941:=CN=Linux-SA,OU=Groups,DC=global,DC=example,DC=com)(!(objectClass=computer))(uidNumber=*)(unixHomeDirectory=*)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))
map passwd uid sAMAccountName
map passwd homeDirectory unixHomeDirectory
map passwd gecos displayName
map passwd loginShell "/bin/bash"
filter shadow (&(objectClass=user)(!(objectClass=computer))(uidNumber=*)(unixHomeDirectory=*))
map shadow uid sAMAccountName
map shadow shadowLastChange pwdLastSet
filter group (&(objectClass=group)(gidNumber=*))
map group uniqueMember member