Samba on Ubuntu 18.04 Password Problems
Upgrading my file server from Samba version 3.6.3 to version 4.7.6 caused me some head aches. I don't run a domain controller. Just a stand alone server. The user on a Windows 7 user logs into a local Windows account. The username and password are the same on both the Ubuntu server and the Windows client.
Trying to connect to my samba share, the Windows 7 client kept asking for my password and insisted it was incorrect.
I know that Samba passwords need to be set using the command
and i tried that. That was not the reason.
Hours of trial and error. Then I finally found the reason: Samba by default only supports the more secure NTLMv2.
Windows by default is set to "Send LM & NTLM - use NTLMv2 session security if negotiated". That means Windows first tries NTML and tries to upgrade to NTLMv2.
Since Samba does not support the old NTLM, the negotiation never takes place.
There are two solutions:
Change the Client settings to use NTLMv2: Run
gpedit.msc on your Windows client and navigate to
Computer Configuration\Windows Settings\Security Settings\Local Policies\Security Options and set it to
"Send NTLMv2 response only\refuse LM & NTLM
Or if you don't want to change your client settings, edit
/etc/samba/smb.conf and add to the
lanman auth = no ntlm auth = yes
restart samba and Windows 7 talks to your Ubuntu 18.04 server.