Portál AbcLinuxu, 12. května 2025 08:43

Dotaz: LDAP s certifikátem

16.8.2009 13:13 jnovacek | skóre: 22 | blog: NovLin
LDAP s certifikátem
Přečteno: 488×
Odpovědět | Admin

Potřebuji poradit ohledně LDAP a smbldap-tools. Nedokážu pomocí utilit smbldap nic vytvořit (smbldap-useradd -m -a uzivatel). Dostávám hlášení:

Could not find base dn, to get next uidNumber at /usr/sbin//smbldap_tools.pm line 1179, <DATA> line 466.
Hledal jsem co je toho příčinou a nejspíš to je neuvedení právě certifikátů v smbldap.conf.

Jak vygeneruji ty soubory "ca.pem", "smbldap-tools.iallanis.info.pem", "smbldap-tools.iallanis.info.key"

Používám SLES 11

Ukázka vzorové konfigurace

# Use TLS for LDAP
# If set to 1, this option will use start_tls for connection
# (you should also used the port 389)
# If not defined, parameter is set to "0"
ldapTLS="1"

# Use SSL for LDAP
# If set to 1, this option will use SSL for connection
# (standard port for ldaps is 636)
# If not defined, parameter is set to "0"
ldapSSL="0"

# How to verify the server's certificate (none, optional or require)
# see "man Net::LDAP" in start_tls section for more details
verify="require"

# CA certificate
# see "man Net::LDAP" in start_tls section for more details
cafile="/etc/smbldap-tools/ca.pem"

# certificate to use to connect to the ldap server
# see "man Net::LDAP" in start_tls section for more details
clientcert="/etc/smbldap-tools/smbldap-tools.iallanis.info.pem"

# key certificate to use to connect to the ldap server
# see "man Net::LDAP" in start_tls section for more details
clientkey="/etc/smbldap-tools/smbldap-tools.iallanis.info.key"
 

Nástroje: Začni sledovat (0) ?Zašle upozornění na váš email při vložení nového komentáře.

Odpovědi

16.8.2009 18:05 timeos | skóre: 32
Rozbalit Rozbalit vše Re: LDAP s certifikátem
Odpovědět | | Sbalit | Link | Blokovat | Admin
nemyslim ze je problem v certifikatoch... chyba sa zameriava na LDAP problem s identifikaciou base DN pre DIT. To znamena ze spojenie cez TLS sa vytvorilo, problem je dostat konkretne data z LDAPu... nespecifikovali ste asi nejaky parameter z smbldap.conf ... konkretne suffix resp. sambaUnixIdPooldn.
16.8.2009 19:45 jnovacek | skóre: 22 | blog: NovLin
Rozbalit Rozbalit vše Re: LDAP s certifikátem

Kontroloval jsem to a mám to v konfiguračním souboru dobře. Když zadám špatně sambaUnixIdPooldn tak se ukáže toto

Error looking for next uid in sambaDomainName=tojespatne,ou=Domains,dc=organizace:No such object at ...

V manuálu jsem našel na předchozí chybu toto:

Could not find base dn, to get next uidNumber at /usr/local/sbin//smbldap_tools.pm line 909
  1. you do not have created the object to defined the next uidNumber and gidNumber available.
    • for version 0.8.7 : you can just run the smbldap-populate script that will update the sambaDomain entry to store those informations
    • for version before 0.8.7 : You have updated the smbldap-tools to version 0.8.5 or newer. You have to do this manually. Create an file called add.ldif and containing
      dn: cn=NextFreeUnixId,dc=idealx,dc=org
      objectClass: inetOrgPerson
      objectClass: sambaUnixIdPool
      uidNumber: 1000
      gidNumber: 1000
      cn: NextFreeUnixId
      sn: NextFreeUnixId
      
      and then add the object with the ldapadd utility:
      $ ldapadd -x -D "cn=Manager,dc=idealx,dc=org" -w secret -f add.ldif
      
      Here, 1000 is the first available value for uidNumber and gidNumber (of course, if this value is already used by a user or a group, the first available after 1000 will be used).
  2. The error also appear when there is a need for TLS (ldapTLS=1 in smbldap.conf) and something is wrong with certificate naming or path settings.

Právě proto se domnívám, že je problém v bodu 2. Nevím jak ty soubory získat nebo vygenerovat.

16.8.2009 21:07 jnovacek | skóre: 22 | blog: NovLin
Rozbalit Rozbalit vše Re: LDAP s certifikátem
Odpovědět | | Sbalit | Link | Blokovat | Admin

Tak google nic kloudného neřekl, ale vyzkoušel jsem si to vše udělat znova a při vytváření objektu domény jsem nedal tuto položku

sambaNextUserRid: 1000

Vše hned začalo fungovat i bez těch certifikátů

Založit nové vláknoNahoru

Tiskni Sdílej: Linkuj Jaggni to Vybrali.sme.sk Google Del.icio.us Facebook

ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.