libpam-ldapd não está procurando grupos secundários

1

Estou migrando de libpam-ldap para libpam-ldapd . Estou tendo algum problema para reunir os grupos secundários do LDAP.

Em libpam-ldap , eu tive isso no arquivo /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=Groups,ou=CITIUS,dc=inv,dc=usc,dc=es
nss_map_attribute       uniqueMember  member

O mapeamento está lá porque estou usando groupOfNames em vez de groupOfUniqueNames classe LDAP para grupos, portanto, o atributo que nomeia os membros é denominado member em vez de uniqueMember .

Agora, quero fazer o mesmo usando libpam-ldapd , mas não consigo fazer isso funcionar. Aqui está a parte relevante do meu /etc/nslcd.conf :

base passwd         ou=People,ou=CITIUS,dc=inv,dc=usc,dc=es
base shadow         ou=People,ou=CITIUS,dc=inv,dc=usc,dc=es
base group          ou=Groups,ou=CITIUS,dc=inv,dc=usc,dc=es
map group uniqueMember member

E esta é a saída de depuração do nslcd, quando um usuário é autenticado:

nslcd: [8b4567] DEBUG: connection from pid=12090 uid=0 gid=0
nslcd: [8b4567] DEBUG: nslcd_passwd_byuid(4004)
nslcd: [8b4567] DEBUG: myldap_search(base="ou=People,ou=CITIUS,dc=inv,dc=usc,dc=es", filter="(&(objectClass=posixAccount)(uidNumber=4004))")
nslcd: [8b4567] DEBUG: ldap_initialize(ldap://172.16.54.31/)
nslcd: [8b4567] DEBUG: ldap_set_rebind_proc()
nslcd: [8b4567] DEBUG: ldap_set_option(LDAP_OPT_PROTOCOL_VERSION,3)
nslcd: [8b4567] DEBUG: ldap_set_option(LDAP_OPT_DEREF,0)
nslcd: [8b4567] DEBUG: ldap_set_option(LDAP_OPT_TIMELIMIT,10)
nslcd: [8b4567] DEBUG: ldap_set_option(LDAP_OPT_TIMEOUT,10)
nslcd: [8b4567] DEBUG: ldap_set_option(LDAP_OPT_NETWORK_TIMEOUT,10)
nslcd: [8b4567] DEBUG: ldap_set_option(LDAP_OPT_REFERRALS,LDAP_OPT_ON)
nslcd: [8b4567] DEBUG: ldap_set_option(LDAP_OPT_RESTART,LDAP_OPT_ON)
nslcd: [8b4567] DEBUG: ldap_simple_bind_s("uid=ubuntu,ou=Applications,ou=CITIUS,dc=inv,dc=usc,dc=es","*****") (uri="ldap://172.16.54.31/")
nslcd: [8b4567] connected to LDAP server ldap://172.16.54.31/
nslcd: [8b4567] DEBUG: ldap_result(): end of results
nslcd: [7b23c6] DEBUG: connection from pid=15906 uid=0 gid=2000
nslcd: [7b23c6] DEBUG: nslcd_pam_authc("jorge.suarez","","su","***")
nslcd: [7b23c6] DEBUG: myldap_search(base="ou=People,ou=CITIUS,dc=inv,dc=usc,dc=es", filter="(&(objectClass=posixAccount)(uid=jorge.suarez))")
nslcd: [7b23c6] DEBUG: ldap_initialize(ldap://172.16.54.31/)
nslcd: [7b23c6] DEBUG: ldap_set_rebind_proc()
nslcd: [7b23c6] DEBUG: ldap_set_option(LDAP_OPT_PROTOCOL_VERSION,3)
nslcd: [7b23c6] DEBUG: ldap_set_option(LDAP_OPT_DEREF,0)
nslcd: [7b23c6] DEBUG: ldap_set_option(LDAP_OPT_TIMELIMIT,10)
nslcd: [7b23c6] DEBUG: ldap_set_option(LDAP_OPT_TIMEOUT,10)
nslcd: [7b23c6] DEBUG: ldap_set_option(LDAP_OPT_NETWORK_TIMEOUT,10)
nslcd: [7b23c6] DEBUG: ldap_set_option(LDAP_OPT_REFERRALS,LDAP_OPT_ON)
nslcd: [7b23c6] DEBUG: ldap_set_option(LDAP_OPT_RESTART,LDAP_OPT_ON)
nslcd: [7b23c6] DEBUG: ldap_simple_bind_s("uid=ubuntu,ou=Applications,ou=CITIUS,dc=inv,dc=usc,dc=es","*****") (uri="ldap://172.16.54.31/")
nslcd: [7b23c6] connected to LDAP server ldap://172.16.54.31/
nslcd: [7b23c6] DEBUG: ldap_initialize(ldap://172.16.54.31/)
nslcd: [7b23c6] DEBUG: ldap_set_rebind_proc()
nslcd: [7b23c6] DEBUG: ldap_set_option(LDAP_OPT_PROTOCOL_VERSION,3)
nslcd: [7b23c6] DEBUG: ldap_set_option(LDAP_OPT_DEREF,0)
nslcd: [7b23c6] DEBUG: ldap_set_option(LDAP_OPT_TIMELIMIT,10)
nslcd: [7b23c6] DEBUG: ldap_set_option(LDAP_OPT_TIMEOUT,10)
nslcd: [7b23c6] DEBUG: ldap_set_option(LDAP_OPT_NETWORK_TIMEOUT,10)
nslcd: [7b23c6] DEBUG: ldap_set_option(LDAP_OPT_REFERRALS,LDAP_OPT_ON)
nslcd: [7b23c6] DEBUG: ldap_set_option(LDAP_OPT_RESTART,LDAP_OPT_ON)
nslcd: [7b23c6] DEBUG: 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] connected to LDAP server ldap://172.16.54.31/
nslcd: [7b23c6] DEBUG: myldap_search(base="uid=jorge.suarez,ou=People,ou=CITIUS,dc=inv,dc=usc,dc=es", filter="(objectClass=posixAccount)")
nslcd: [7b23c6] DEBUG: ldap_unbind()
nslcd: [3c9869] DEBUG: connection from pid=15906 uid=0 gid=2000
nslcd: [3c9869] DEBUG: nslcd_pam_sess_o("jorge.suarez","uid=jorge.suarez,ou=People,ou=CITIUS,dc=inv,dc=usc,dc=es","su","/dev/pts/7","","jorge.suarez")

Parece-me que nem sequer tentará procurar grupos. O que estou fazendo errado? Não vejo nada relevante para as informações sobre meus problemas nos documentos . Provavelmente não estou entendendo como a opção map funciona.

    
por Jorge Suárez de Lis 29.08.2012 / 12:19

1 resposta

0

Acredito que o parâmetro map group precisa ser associado a um parâmetro filter group correspondente. Aqui está como eu o uso conectando ao 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
    
por 29.08.2012 / 15:52