Samba 4 在 samba-tool 域加入时显示“无法找到域的可写 DC”

Samba 4 在 samba-tool 域加入时显示“无法找到域的可写 DC”

我有一个 CentOS 6.4 机器,安装了 SerNet 的 Samba 4.0.8 并还没有 smb.conf 文件,因为它应该是。我希望它成为我现有 Windows 域中的 AD DC,从现有 Windows Server 2003 机器进行复制。我启用了 SELinux,并希望它最终保持这种状态,但愿意尝试暂时禁用它。但我已经运行sudo setsebool -P samba_domain_controller onsudo setsebool -P samba_enable_home_dirs on他们没有返回任何错误。

我还选择尝试使用 Samba 4 的内部 DNS 而不是 BIND。

我在尝试运行 samba-tool 时遇到此错误:

$ sudo samba-tool domain join currentwindowsadserver.mydomain.lan DC -Uadministrator --realm=currentwindowsadserver.mydomain.lan
Finding a writeable DC for domain 'currentwindowsadserver.mydomain.lan'
ERROR(exception): uncaught exception - Failed to find a writeable DC for domain 'currentwindowsadserver.mydomain.lan'
  File "/usr/lib64/python2.6/site-packages/samba/netcmd/__init__.py", line 175, in _run
    return self.run(*args, **kwargs)
  File "/usr/lib64/python2.6/site-packages/samba/netcmd/domain.py", line 552, in run
    machinepass=machinepass, use_ntvfs=use_ntvfs, dns_backend=dns_backend)
  File "/usr/lib64/python2.6/site-packages/samba/join.py", line 1082, in join_DC
    machinepass, use_ntvfs, dns_backend, promote_existing)
  File "/usr/lib64/python2.6/site-packages/samba/join.py", line 73, in __init__
    ctx.server = ctx.find_dc(domain)
  File "/usr/lib64/python2.6/site-packages/samba/join.py", line 246, in find_dc
    raise Exception("Failed to find a writeable DC for domain '%s'" % domain)

情况与描述相同这里,但建议-S似乎不再存在——当我尝试它时它会吐出使用说明并说:

samba-tool domain join: error: no such option: -S

我试过将旧的和新的添加到/etc/hosts但这并没有改变结果。

kinit并按klist其应有的方式工作,并且host -t A mynewserver还产生正确的输出(给出正确的 IP 和正确的名称,请参见下文。)

目前,我的 Windows AD 服务器有 5 个名称和 5 个 IP 地址,但如果我从 CentOS 通过我用于所有 Windows 的主名称(另外 4 个我只用于 Apache,是的,我知道,在 Windows 上运行 Apache)来 ping 它。 ..您可以看到我为什么要迁移)它会正确返回该名称。尽管如此,我认为这可能会导致一些问题,所以看到这一页(甚至samba-tool domain join -h)我也尝试添加--ipaddress=192.168.1.2,它说这也不是一个有效的选项:

samba-tool domain join: error: no such option: --ip-address

samba-tool domain info没有DC但在其他方面与开始时相同的参数,正确地为我提供了有关 Windows DC 的信息。 DNS 似乎也很好:

$ host -t SRV _ldap._tcp.mydomain.lan
_ldap._tcp.mydomain.lan has SRV record 0 100 389 currentwindowsadserver.mydomain.lan
$ host -t SRV _kerberos._udp.mydomain.lan
_kerberos._udp.mydomain.lan has SRV record 0 100 88 currentwindowsadserver.mydomain.lan
$ host -t SRV _ldap._tcp.dc._msdcs.mydomain.lan
_ldap._tcp.dc._msdcs.mydomain.lan has SRV record 0 100 389 currentwindowsadserver.mydomain.lan
$ host -t SRV _kerberos._tcp.dc._msdcs.mydomain.lan
_kerberos._tcp.dc._msdcs.mydomain.lan has SRV record 0 100 88 currentwindowsadserver.mydomain.lan
$ host -t SRV _kpasswd._tcp.mydomain.lan
_kpasswd._tcp.mydomain.lan has SRV record 0 100 464 currentwindowsadserver.mydomain.lan.
$ host -t SRV _kpasswd._udp.mydomain.lan
_kpasswd._udp.mydomain.lan has SRV record 0 100 464 currentwindowsadserver.mydomain.lan.
$ host -t SRV _ldap._tcp.gc._msdcs.mydomain.lan
_ldap._tcp.gc._msdcs.mydomain.lan has SRV record 0 100 3268 currentwindowsadserver.mydomain.lan.
$ host -t SRV _gc._tcp.mydomain.lan
_gc._tcp.mydomain.lan has SRV record 0 100 3268 currentwindowsadserver.mydomain.lan.

ATM,据我所知,我们是纯 IPv4 网络(一页提到了 IPv6 问题)。当我 ping 或运行或类似的东西时,我看不到任何 IPv6 地址host -t A- 如果这是问题,我不确定如何验证或修复它,也许有人可以帮助我解决这个问题。

sudo netstat -tunpe | grep ":53"什么都不返回,我有iptables 在 445 UDP 和 TCP 上打开。更新,我现在打开的是这里列出的所有内容除了 NetBIOS 之外,重新加载 iptables 没有错误,但仍然没有变化。我也尝试过暂时停止 iptables 服务,没有什么区别。

我还在中的 mydomain.lan 后面加上了domain和指令,以及Windows 盒子的主 IP。search/etc/resolv.confnameserver

还能是什么?谷歌没有给我太多其他的尝试。

答案1

我向 samba-tool 传递了错误的信息。 currentwindowsadserver是 dc,而不是域或领域。代替:

sudo samba-tool domain join currentwindowsadserver.mydomain.lan DC -Uadministrator --realm=currentwindowsadserver.mydomain.lan

...命令应该简单地写为:

sudo samba-tool domain join mydomain.lan DC -Uadministrator --realm=mydomain.lan

这成功了,SELinux 仍然启用,并且domainresolv.conf 中的指令被注释掉。

相关内容