Portál AbcLinuxu, 12. května 2025 08:43
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"
smbldap.conf
... konkretne suffix
resp. sambaUnixIdPooldn
.
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
dn: cn=NextFreeUnixId,dc=idealx,dc=org objectClass: inetOrgPerson objectClass: sambaUnixIdPool uidNumber: 1000 gidNumber: 1000 cn: NextFreeUnixId sn: NextFreeUnixIdand then add the object with the ldapadd utility:
$ ldapadd -x -D "cn=Manager,dc=idealx,dc=org" -w secret -f add.ldifHere, 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).
Právě proto se domnívám, že je problém v bodu 2. Nevím jak ty soubory získat nebo vygenerovat.
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ů
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.