Eu tenho um servidor CentOS 7 com o Samba 4.6.2, associado a um domínio do Windows Server 2008 R2, e não consigo acessar nenhum compartilhamento do Windows usando o nome de host do servidor ou o FQDN, apenas pelo endereço IP.
Eu verifiquei que o DNS está trabalhando com nslookup para servidor para cliente, cliente para servidor e verifiquei todos os registros SRV para resolução de AD no servidor samba.
Quando eu tento usar o nome do host ou o FQDN, o Windows exibe um erro "Falha de logon: o nome da conta de destino está incorreto" e os logs do samba para o cliente mostram isso:
[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)
Configuração do 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
Não sei o que estou perdendo ou o que mais solucionar. Reunir o domínio e até mesmo eliminar a configuração do samba não ajudou. Eu também adicionei manualmente cifs para o keytab, mas o Windows continuará solicitando um nome de usuário e senha, mesmo quando estiver correto. Alguma idéia?