Eu configurei recentemente um compartilhamento de arquivo SAMBA. Depois de passar por uma série de etapas, finalmente consegui que a maioria dos meus computadores visse esse servidor. Os principais requisitos eram: 1) tinha que ser protegido por senha, 2) ter vários usuários, 3) cada usuário pode possuir um arquivo, mas todos os usuários podem gravar nos arquivos uns dos outros.
Estou em um escritório com 5 Macs, 1 servidor Linux (Ubuntu 13.04), 1 Windows Server (Windows 2008 R2) e três desktops Windows XP Pro. Todos os computadores podem acessar o compartilhamento corretamente, exceto os Macs.
Por incrível que pareça, o ONE Mac é capaz de visualizar o compartilhamento e o login. Todos os outros Macs não conseguem fazer o login depois de colocar o nome de usuário e senha.
Aqui está o conteúdo do meu arquivo smb.conf:
[global]
workgroup = workgroup
server string = %h server (Samba, Ubuntu)
dns proxy = no
log file = /var/log/samba/log.%m
max log size = 1000
syslog = 0
panic action = /usr/share/samba/panic-action %d
security = user
encrypt passwords = yes
obey pam restrictions = yes
unix password sync = yes
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
pam password change = yes
map to guest = bad user
usershare allow guests = yes
username map = /etc/samba/smbusers
guest ok = no
guest account = nobody
comment = Home Directories
browseable = no
read only = no
create mask = 0775
directory mask = 0775
[printers]
comment = All Printers
browseable = no
path = /var/spool/samba
printable = yes
; guest ok = no
; read only = yes
create mask = 0700
[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
[interactive]
path = /home/shok07a/interactive
writeable = yes
browseable = yes
comment = interactive
create mask = 0777
directory mask = 2777
force directory mode = 2777
guest ok = no
force group = sambashare
Logs:
inicie log.nmbd:
[2013/08/26 08:51:27.730313, 0] nmbd/nmbd_nameregister.c:492(register_name)
register_name: NetBIOS name SHOK07A-INTERACTIVE-SERVER is too long. Truncating to SHOK07A-INTERAC
[2013/08/26 08:51:27.730464, 0] nmbd/nmbd_nameregister.c:492(register_name)
register_name: NetBIOS name SHOK07A-INTERACTIVE-SERVER is too long. Truncating to SHOK07A-INTERAC
[2013/08/26 08:51:27.730526, 0] nmbd/nmbd_nameregister.c:492(register_name)
register_name: NetBIOS name SHOK07A-INTERACTIVE-SERVER is too long. Truncating to SHOK07A-INTERAC
[2013/08/26 08:53:02.002178, 0] nmbd/nmbd_become_lmb.c:397(become_local_master_stage2)
*****
Samba name server SHOK07A-INTERACTIVE-SERVER is now a local master browser for workgroup WORKGROUP on subnet 10.42.0.1
*****
[2013/08/26 16:45:47.916574, 0] libsmb/nmblib.c:856(send_udp)
Packet send failed to 10.42.0.255(138) ERRNO=Invalid argument
[2013/08/26 16:45:47.916689, 0] libsmb/nmblib.c:856(send_udp)
Packet send failed to 10.42.0.255(138) ERRNO=Invalid argument
[2013/08/26 16:58:56.608481, 0] nmbd/nmbd_incomingdgrams.c:311(process_local_master_announce)
process_local_master_announce: Server SHOK09A-PC at IP 10.42.0.92 is announcing itself as a local master browser for workgroup WORKGROUP and we think we are master. Forcing election.
[2013/08/26 16:58:56.608685, 0] nmbd/nmbd_become_lmb.c:150(unbecome_local_master_success)
*****
Samba name server SHOK07A-INTERACTIVE-SERVER has stopped being a local master browser for workgroup WORKGROUP on subnet 192.168.1.35
*****
[2013/08/26 16:58:56.609163, 0] nmbd/nmbd_nameregister.c:492(register_name)
register_name: NetBIOS name SHOK07A-INTERACTIVE-SERVER is too long. Truncating to SHOK07A-INTERAC
[2013/08/26 16:58:56.609241, 0] nmbd/nmbd_nameregister.c:492(register_name)
register_name: NetBIOS name SHOK07A-INTERACTIVE-SERVER is too long. Truncating to SHOK07A-INTERAC
[2013/08/26 16:58:56.609334, 0] nmbd/nmbd_nameregister.c:492(register_name)
register_name: NetBIOS name SHOK07A-INTERACTIVE-SERVER is too long. Truncating to SHOK07A-INTERAC
[2013/08/26 16:59:13.629340, 0] nmbd/nmbd_become_lmb.c:397(become_local_master_stage2)
*****
Samba name server SHOK07A-INTERACTIVE-SERVER is now a local master browser for workgroup WORKGROUP on subnet 192.168.1.35
*****
end log.nmbd
Nenhum dos outros registros mostrou nada. Eles estavam vazios. Eu os salvei de qualquer maneira, limpei logs e tentei me conectar novamente. Novamente, nada apareceu nos meus registros.
Eu pinguei a máquina do Mac e todos os pings passam muito bem. Eu sou solicitado a digitar o nome de usuário e senha.
Parece que as máquinas podem "ver" umas às outras, mas a autenticação está falhando.
EDIT (mais registros):
[2013/08/27 09:28:29.864230, 2] smbd/reply.c:553(reply_special)
netbios connect: name1=192.168.1.35 0x20 name2=STATION-4 0x0
[2013/08/27 09:28:29.864427, 2] smbd/reply.c:573(reply_special)
netbios connect: local=192.168.1.35 remote=station-4, name type = 0
[2013/08/27 09:34:29.843796, 2] smbd/reply.c:553(reply_special)
netbios connect: name1=192.168.1.35 0x20 name2=STATION-4 0x0
[2013/08/27 09:34:29.844328, 2] smbd/reply.c:573(reply_special)
netbios connect: local=192.168.1.35 remote=station-4, name type = 0
[2013/08/27 09:40:29.850174, 2] smbd/reply.c:553(reply_special)
netbios connect: name1=192.168.1.35 0x20 name2=STATION-4 0x0
[2013/08/27 09:40:29.850389, 2] smbd/reply.c:573(reply_special)
netbios connect: local=192.168.1.35 remote=station-4, name type = 0
A Estação 4 é um dos Macs que não podem se conectar.
Inicie o log.smbd
[2013/08/27 09:25:40, 0] smbd/server.c:1026(main)
smbd version 3.6.9 started.
Copyright Andrew Tridgell and the Samba Team 1992-2011
[2013/08/27 09:25:40, 2] lib/tallocmsg.c:124(register_msg_pool_usage)
Registered MSG_REQ_POOL_USAGE
[2013/08/27 09:25:40, 2] lib/dmallocmsg.c:78(register_dmalloc_msgs)
Registered MSG_REQ_DMALLOC_MARK and LOG_CHANGED
[2013/08/27 09:25:40.140866, 2] param/loadparm.c:4985(max_open_files)
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
[2013/08/27 09:25:40.141089, 2] param/loadparm.c:8327(do_section)
Processing section "[printers]"
[2013/08/27 09:25:40.141181, 2] param/loadparm.c:8327(do_section)
Processing section "[print$]"
[2013/08/27 09:25:40.141246, 2] param/loadparm.c:8327(do_section)
Processing section "[interactive]"
[2013/08/27 09:25:40.141494, 2] lib/interface.c:341(add_interface)
added interface wlan0 ip=fe80::6a94:23ff:feb3:3a9b%wlan0 bcast=fe80::ffff:ffff:ffff:ffff%wlan0 netmask=ffff:ffff:ffff:ffff::
[2013/08/27 09:25:40.141605, 2] lib/interface.c:341(add_interface)
added interface eth0 ip=fe80::7a45:c4ff:fe06:2876%eth0 bcast=fe80::ffff:ffff:ffff:ffff%eth0 netmask=ffff:ffff:ffff:ffff::
[2013/08/27 09:25:40.141655, 2] lib/interface.c:341(add_interface)
added interface wlan0 ip=192.168.1.35 bcast=192.168.1.255 netmask=255.255.255.0
[2013/08/27 09:25:40.141688, 2] lib/interface.c:341(add_interface)
added interface eth0 ip=10.42.0.1 bcast=10.42.0.255 netmask=255.255.255.0
[2013/08/27 09:25:40.141783, 0] smbd/server.c:1082(main)
standard input is not a socket, assuming -D option
[2013/08/27 09:25:40.147336, 2] smbd/server.c:815(smbd_parent_loop)
waiting for connections
[2013/08/27 09:25:40.151155, 2] rpc_client/cli_winreg_spoolss.c:896(winreg_create_printer)
winreg_create_printer: Skipping, SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers\Officejet_7500_E910__4C53E0_ already exists
[2013/08/27 09:25:40.151234, 2] smbd/server.c:301(remove_child_pid)
Could not find child 25727 -- ignoring
Finalize log.smbd
EDIT Aqui está o maior registro relativo:
2013/08/27 10:37:45.149211, 2] auth/auth.c:319(check_ntlm_password)
check_ntlm_password: Authentication for user [shok10a] -> [shok10a] FAILED with error NT_STATUS_WRONG_PASSWORD
A senha NÃO está errada, no entanto.