[Samba] trying to set trust throws error

itdept_head itdept_head at grown-up.com
Thu Feb 9 04:16:22 UTC 2023


This is a little complex…
Since one domain is a rename of the other. (testing rename tool for working out a full procedure)
Renamed an old domain, but want to be able  to access the NAS that are bound to the old domain.
The NAS can only be bound to 1 domain.
Which means there needs to be a trust. From the  new renamed domain to the old domain
so that  the NAS can send the request to the new domain that then routes the request to the old domain.
It’s needed so that the new domain groups can be reconstructed on the NAS & tested, before removal of the old groups


Could this perhaps be due to the SID?

The second “unbound error” I think relates to the fact that early code does not exit correctly on the “failed remote”, which leaves unbound variables.

Both servers can see each other & connection can be made:



root at dc02:~# samba-tool domain trust create GP01 -UGP01\\Administrator --type=external

LocalDomain Netbios[ORG] DNS[org.blown-up.com] SID[S-1-5-21-1054434277-4207674981-198073344]

RemoteDC Netbios[AD01] DNS[ad01.gp01.org.blown-up.com] ServerType[PDC,GC,LDAP,DS,KDC,TIMESERV,CLOSEST,WRITABLE,GOOD_TIMESERV,FULL_SECRET_DOMAIN_6]

Password for [GP01\Administrator]:

RemoteDomain Netbios[GP01] DNS[gp01.org.blown-up.com] SID[S-1-5-21-1054434277-4207674981-198073344]

Creating remote TDO.

Error: CreateTrustedDomainEx2 failed remotely - cleaning up

ERROR(<class 'UnboundLocalError'>): uncaught exception - local variable 'remote_tdo_handle' referenced before assignment

  File "/usr/lib/python3/dist-packages/samba/netcmd/__init__.py", line 186, in _run

    return self.run(*args, **kwargs)

  File "/usr/lib/python3/dist-packages/samba/netcmd/domain.py", line 2765, in run

    if remote_tdo_handle:


Thanks…


More information about the samba mailing list