[Samba] Interacting with LDAP db without password as root

Rowland penny rpenny at samba.org
Wed Jul 15 14:23:41 UTC 2020


On 15/07/2020 14:56, RhineDevil wrote:
> Wed, 15 Jul 2020 13:56:48 +0100 Rowland penny via samba <samba at lists.samba.org>:
>> On 15/07/2020 13:36, RhineDevil via samba wrote:
>>> How could I avoid being asked a password when interacting with /var/lib/samba/private/ldap_priv/ldapi through ldapsearch or ldaputils in general?
>>> (ldapsearch -H ldapi//%2Fvar%2Flib%2Fsamba%2Fprivate%2Fldapi)
>> Don't use ldap-utils, use ldb-tools and the machine password:
>>
>> sudo ldbsearch -P -H ldapi://%2Fvar%2Flib%2Fsamba%2Fprivate%2Fldap
>>
>> Rowland
> "ldap client internal error NT_STATUS_UNSUCCESFUL"

Strange, I get:

root at dc01:~# ldbsearch -P -H ldapi://%2Fvar%2Flib%2Fsamba%2Fprivate%2Fldapi
ALL_MY_AD_RECORDS

Snipped for brevity

.....................
...................
.................
# Referral
ref: ldap://samdom.example.com/CN=Configuration,DC=samdom,DC=example,DC=com

# Referral
ref: ldap://samdom.example.com/DC=DomainDnsZones,DC=samdom,DC=example,DC=com

# Referral
ref: ldap://samdom.example.com/DC=ForestDnsZones,DC=samdom,DC=example,DC=com

# returned 479 records
# 476 entries
# 3 referrals

You are running this on a DC ?

Rowland





More information about the samba mailing list