TransWikia.com

Openldap+samba pdb_init_ldapsam: WARNING: Could not get domain info, nor add one to the domain. We cannot work reliably without it

Server Fault Asked by Bruce on January 27, 2021

After integration samba with openldap i got this type of error while trying to restart smb.service :
juil. 20 13:28:41 ldapmaster smbd[9761]: [2020/07/20 13:28:41.008764, 0] ../../source3/passdb/pdb_ldap.c:6680(pdb_ldapsam_init_common)
juil. 20 13:28:41 ldapmaster smbd[9761]: pdb_init_ldapsam: WARNING: Could not get domain info, nor add one to the domain. We cannot work reliably without it.
juil. 20 13:28:41 ldapmaster smbd[9761]: [2020/07/20 13:28:41.009325, 0] ../../source3/passdb/pdb_interface.c:180(make_pdb_method_name)
juil. 20 13:28:41 ldapmaster smbd[9761]: pdb backend ldapsam:ldap://172.16.0.180 did not correctly init (error was NT_STATUS_CANT_ACCESS_DOMAIN_INFO)
juil. 20 13:28:41 ldapmaster slapd[1217]: conn=1084 fd=11 closed (connection lost)
juil. 20 13:28:41 ldapmaster systemd[1]: smb.service: main process exited, code=exited, status=1/FAILURE
juil. 20 13:28:41 ldapmaster systemd[1]: Failed to start Samba SMB Daemon.
— Subject: L’unité (unit) smb.service a échoué

One Answer

Your LDAP database is missing the domain info and samba is not able to add it. This probably is related to the samba.schema missing from the LDAP itself. Depending on where you linux distribution store the samba schema definition file, may probably fix it with these commands:

root@hostnane:~# ldapadd -Q -Y EXTERNAL -H ldapi:/// -f /tmp/samba.ldif
root@hostnane:~# cat > samba_indices.ldif
dn: olcDatabase={1}mdb,cn=config
changetype: modify
replace: olcDbIndex
olcDbIndex: objectClass eq
olcDbIndex: uidNumber,gidNumber eq
olcDbIndex: loginShell eq
olcDbIndex: uid,cn eq,sub
olcDbIndex: memberUid eq,sub
olcDbIndex: member,uniqueMember eq
olcDbIndex: sambaSID eq
olcDbIndex: sambaPrimaryGroupSID eq
olcDbIndex: sambaGroupType eq
olcDbIndex: sambaSIDList eq
olcDbIndex: sambaDomainName eq
olcDbIndex: default sub,eq
root@hostnane:~# ldapmodify -Q -Y EXTERNAL -H ldapi:/// -f samba_indices.ldif
modifying entry "olcDatabase={1}mdb,cn=config"

then, you may check if this worked correctly with command

root@hostnane:~# net GETLOCALSID

Answered by eppesuig on January 27, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP