我有一台安装了 Samba 4.6.2 的 CentOS 7 服务器,加入了 Windows Server 2008 R2 域,但无法使用服务器的主机名或 FQDN 从 Windows 访问任何共享,只能通过 IP 地址访问。
我已经验证 DNS 正在与服务器到客户端、客户端到服务器的 nslookup 协同工作,并且验证了 samba 服务器上 AD 解析的所有 SRV 记录。
当我尝试使用主机名或 FQDN 时,Windows 将显示错误“登录失败:目标帐户名不正确”,并且客户端的 samba 日志显示以下内容:
[2017/09/28 13:04:00.119699, 3] ../source3/smbd/oplock.c:1322(init_oplocks)
init_oplocks: initializing messages.
[2017/09/28 13:04:00.119899, 3] ../source3/smbd/process.c:1957(process_smb)
Transaction 0 of length 159 (0 toread)
[2017/09/28 13:04:00.119956, 3] ../source3/smbd/process.c:1538(switch_message)
switch message SMBnegprot (pid 15584) conn 0x0
[2017/09/28 13:04:00.120920, 3] ../source3/smbd/negprot.c:603(reply_negprot)
Requested protocol [PC NETWORK PROGRAM 1.0]
[2017/09/28 13:04:00.120968, 3] ../source3/smbd/negprot.c:603(reply_negprot)
Requested protocol [LANMAN1.0]
[2017/09/28 13:04:00.120999, 3] ../source3/smbd/negprot.c:603(reply_negprot)
Requested protocol [Windows for Workgroups 3.1a]
[2017/09/28 13:04:00.121026, 3] ../source3/smbd/negprot.c:603(reply_negprot)
Requested protocol [LM1.2X002]
[2017/09/28 13:04:00.121053, 3] ../source3/smbd/negprot.c:603(reply_negprot)
Requested protocol [LANMAN2.1]
[2017/09/28 13:04:00.121080, 3] ../source3/smbd/negprot.c:603(reply_negprot)
Requested protocol [NT LM 0.12]
[2017/09/28 13:04:00.121107, 3] ../source3/smbd/negprot.c:603(reply_negprot)
Requested protocol [SMB 2.002]
[2017/09/28 13:04:00.121133, 3] ../source3/smbd/negprot.c:603(reply_negprot)
Requested protocol [SMB 2.???]
[2017/09/28 13:04:00.121348, 3] ../source3/smbd/smb2_negprot.c:290(smbd_smb2_request_process_negprot)
Selected protocol SMB2_FF
[2017/09/28 13:04:00.124041, 3] ../source3/smbd/negprot.c:730(reply_negprot)
Selected protocol SMB 2.???
[2017/09/28 13:04:00.135575, 3] ../source3/smbd/smb2_negprot.c:290(smbd_smb2_request_process_negprot)
Selected protocol SMB2_10
[2017/09/28 13:04:00.150178, 1] ../source3/librpc/crypto/gse.c:646(gse_get_server_auth_token)
gss_accept_sec_context failed with [Unspecified GSS failure. Minor code may provide more information: Request ticket server cifs/[email protected] not found in keytab (ticket kvno 10)]
[2017/09/28 13:04:00.161945, 3] ../source3/smbd/server_exit.c:246(exit_server_common)
Server exit (NT_STATUS_CONNECTION_RESET)
[2017/09/28 13:04:00.179981, 3] ../source3/smbd/oplock.c:1322(init_oplocks)
init_oplocks: initializing messages.
[2017/09/28 13:04:00.180172, 3] ../source3/smbd/process.c:1957(process_smb)
Transaction 0 of length 108 (0 toread)
[2017/09/28 13:04:00.198458, 3] ../source3/smbd/smb2_negprot.c:290(smbd_smb2_request_process_negprot)
Selected protocol SMB2_10
[2017/09/28 13:04:00.214297, 1] ../source3/librpc/crypto/gse.c:646(gse_get_server_auth_token)
gss_accept_sec_context failed with [Unspecified GSS failure. Minor code may provide more information: Request ticket server cifs/[email protected] not found in keytab (ticket kvno 10)]
[2017/09/28 13:04:00.227012, 3] ../source3/smbd/server_exit.c:246(exit_server_common)
Server exit (NT_STATUS_CONNECTION_RESET)
Samba 配置:
[global]
workgroup = DOMAIN
realm = DOMAIN.LOCAL
security = ads
template homedir = /home/%U
template shell = /bin/bash
kerberos method = secrets and keytab
winbind use default domain = true
winbind offline logon = true
idmap config * : backend = nss
idmap config * : range = 3000-7999
idmap config DOMAIN : backend = ad
idmap config DOMAIN : default = yes
idmap config DOMAIN : range = 10000-1000000
idmap config DOMAIN : schema_mode = rfc2307
winbind nss info = rfc2307
winbind enum users = yes
winbind enum groups = yes
winbind nested groups = yes
log file = /var/log/samba/log.%m
log level = 3
max log size = 50
client use spnego = yes
load printers = no
cups options = raw
printcap name = /dev/null
我不确定我遗漏了什么,或者还需要排除什么故障。重新加入域甚至清除 samba 配置都无济于事。我还手动将 cifs 添加到 keytab,但即使输入正确,Windows 仍会不断提示输入用户名和密码。有什么想法吗?
答案1
您的 Kerberos 设置已损坏。
来自日志:。Request ticket server cifs/[email protected] not found in keytab (ticket kvno 10)
如果无法使用 Kerberos,似乎还有第二种身份验证方法。第二种方法有效,并且适用于通过 IP 地址访问的情况。这是因为 Kerberos 仅与 DNS 结合使用。
如果您通过 DNS 名称访问,Kerberos 会尝试身份验证但失败。
我想你应该检查所有机器(客户端、服务器、Kerberos 服务器)的 DNS 条目。还要检查 DNS 反向条目。然后生成一个新的密钥表。