将 NT4 SAM 设置与 Samba4 同步 - 可能吗?

将 NT4 SAM 设置与 Samba4 同步 - 可能吗?

我已安装 Samba4 来作为备份域控制器:

james@photon:~$ testparm
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[homes]"
Processing section "[netlogon]"
Processing section "[profiles]"
Processing section "[printers]"
Processing section "[print$]"
Loaded services file OK.
Server role: ROLE_DOMAIN_BDC
Press enter to see a dump of your service definitions

[global]
    workgroup = NT4Domain
    server string = %h NT4 BDC (Samba4, Linux)
    interfaces = lo, eth1
    bind interfaces only = Yes
    server role = classic backup domain controller
    map to guest = Bad User
    obey pam restrictions = Yes
    passdb backend = ldapsam:ldap://127.0.0.1/
    pam password change = Yes
    passwd program = /usr/bin/passwd %u
    passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
    syslog = 0
    log file = /var/log/samba/log.%m
    max log size = 1000
    name resolve order = wins, bcast, hosts
    client signing = if_required
    server signing = if_required
    add user script = /usr/sbin/smbldap-useradd -m '%u' -t 1
    add group script = /usr/sbin/smbldap-groupadd -p '%g'
    add user to group script = /usr/sbin/smbldap-groupmod -m '%u' '%g'
    set primary group script = /usr/sbin/smbldap-usermod -g '%g' '%u'
    add machine script = /usr/sbin/smbldap-useradd -w '%u' -t 1
    logon script = scripts\logon.cmd
    logon path = \\%L\profiles\%U
    logon drive = H:
    logon home = \\%L\%U
    domain logons = Yes
    domain master = No
    dns proxy = No
    wins server = ip.of.nt4.box
    ldap admin dn = cn=admin,dc=thisdomain
    ldap group suffix = ou=Groups
    ldap idmap suffix = ou=Idmap
    ldap machine suffix = ou=People
    ldap passwd sync = yes
    ldap suffix = dc=thisdomain
    ldap ssl = no
    ldap timeout = 20
    ldap user suffix = ou=People
    usershare allow guests = Yes
    panic action = /usr/share/samba/panic-action %d
    winbind cache time = 3600
    winbind enum users = Yes
    winbind enum groups = Yes
    winbind use default domain = Yes
    winbind offline logon = Yes
    idmap config * : backend = tdb
    ea support = Yes
    map acl inherit = Yes

[homes]
    comment = Home Directories
    valid users = %S
    read only = No
    create mask = 0775
    directory mask = 0775
    browseable = No

[netlogon]
    comment = Network Logon Service
    path = /home/samba/netlogon
    guest ok = Yes

[profiles]
    comment = Users profiles
    path = /home/samba/profiles
    create mask = 0600
    directory mask = 0700
    browseable = No

[printers]
    comment = All Printers
    path = /var/spool/samba
    create mask = 0700
    printable = Yes
    print ok = Yes
    browseable = No

[print$]
    comment = Printer Drivers
    path = /var/lib/samba/printers
    write list = root, @lpadmin

它已加入我的 NT4 域。共享打印机可访问,netlogon 共享可见,用户共享可见,并可由域中 Windows 计算机的正确(本地设置)用户浏览。计算机帐户在 NT4 域控制器中可见。它正常工作。

但是,我无法让 net rpc vampire 工作。NT4 域控制器上存储了数百个用户帐户,我需要将它们同步到 Samba 机器上的(工作)LDAP 实例,以便我们可以停用 NT4 机器。

james@photon:~$ sudo net rpc join -U NT4AdminAccount%secret
Joined domain NT4Domain.

然而:

sudo net rpc vampire -U NT4AdminAccount%secret
DC is not running Active Directory
cli_rpc_pipe_open_schannel: failed to get schannel session key from server 127.0.0.1 for domain NT4Domain.
Could not initialise schannel netlogon pipe. Error was NT_STATUS_ACCESS_DENIED

和:

sudo net rpc vampire -S NT4DC -U NT4AdminAccount%secret
DC is not running Active Directory
cli_rpc_pipe_open_schannel: failed to get schannel session key from server data1 for domain ATMOS.
Could not initialise schannel netlogon pipe. Error was NT_STATUS_INVALID_COMPUTER_NAME

当我尝试使用 -d=10 运行 vampire 时看到的相关行是:

result                   : NT_STATUS_INVALID_COMPUTER_NAME
get_schannel_session_key_common: rpccli_netlogon_setup_creds failed with result NT_STATUS_INVALID_COMPUTER_NAME to server NT4DC, domain NT4Domain, machine account SAMBASERVER.
cli_rpc_pipe_open_schannel: failed to get schannel session key from server data1 for domain ATMOS.
Could not initialise schannel netlogon pipe. Error was NT_STATUS_INVALID_COMPUTER_NAME
return code = -1
Freeing parametrics:

那么,经历了这一切之后,到底出了什么问题?vampire 现在坏了吗?我一直读到它已被弃用,但我看到的所有使用 samba-tool domain join 执行此操作的文档都是关于加入活动目录域的。这不是我们想要做的。我还在 schannel 会话密钥错误的上下文中阅读了很多关于 Kerberos 的内容,但这也是活动目录的事情,不是吗?我认为 NT4 使用 LANMAN 来实现现在由 Kerberos 覆盖的那些功能。似乎只有 vampire 操作让我感到困难。其他一切似乎都运行良好……

提前致谢。

相关内容