I have a problem with a samba service on my server. It's began since ubuntu have switched to samba 4.x in their distributions and continues til last one 15.04.
I have a user ag
on my server and user AG
on a Windows 7 box. In samba 3.x everything worked fine but in samba 4.x I've got some funny username mismatch issue.
I observe following behavior: When I login from Windows host I type a username ag
(or AG
it does not matter) and a password. Samba server rejects me for a first time but lets me in on second try. Actually, the same behavior show Linux and Mac OSX clients too, so it's not a Windows issue. I can simulate this from linux console following way:
nas@AGStorage:~$ smbclient -U AG //agvault/backup
Enter AG's password:
session setup failed: NT_STATUS_NO_MEMORY
nas@AGStorage:~$ smbclient -U AG //agvault/backup
Enter AG's password:
Domain=[HOME] OS=[Unix] Server=[Samba 4.1.13-Ubuntu]
smb: \> q
I tried to analyze the behavior with Wireshark and it shows clear that Windows tries first with AG
(remember the user name in Windows is AG
) and gets error, then comes with ag
second time and gets Ok from samba server.
When I simulate the login with ag
it lets in with a single try:
nas@AGStorage:~$ smbclient -U ag //agvault/backup
Enter ag's password:
Domain=[HOME] OS=[Unix] Server=[Samba 4.1.13-Ubuntu]
smb: \> q
I've tried suggested in internet solution: Adding a line username map = /etc/samba/usermap.txt
to my smb.conf
with ag = AG
inside of mentioned usermap.txt
but it does not work in my case.
How can I fix this inconsistent behavior of samba server? Any ideas?
Thanks in advance!