Samba – Older CIFS can not mount shares from Samba-4 server

cifssambasamba4

I have a media-player, which used to connect to my main computer running Samba without a problem. It is running an old version of embedded Linux (kernel 2.6.22.19-27) and has CIFS.

At some point, after I upgraded Samba software on the server (samba-4.6.8 running on FreeBSD-10.4 at the moment), the player lost this ability — it can still list the same exported shares, but can no longer open anything: "wrong credentials".

An SMB-capable application on my phone opens the same folders just fine (using the same credentials)…

Is there some option I need to explicitly turn on the server to enable some sort of compatibility mode with old clients?

Update: based on the suggestion by @Tin, I added the following line to the [global]-section of smb4.conf:

max protocol = NT1

Unfortunately, this hasn't changed things — I can still connect from most systems except the media player, which still tells me, my credentials are no good.

Using tcpdump on the server I captured the following exchange:

    SMB PACKET: SMBnegprot (REQUEST)
    SMB Command   =  0x72
    Error class   =  0x0
    Error code    =  0 (0x0)
    Flags1        =  0x0
    Flags2        =  0x1
    Tree ID       =  0 (0x0)
    Proc ID       =  1283 (0x503)
    UID           =  0 (0x0)
    MID           =  1 (0x1)
    Word Count    =  0 (0x0)
    smb_bcc=12
    Dialect=NT LM 0.12

To which the server responds:

SMB PACKET: SMBnegprot (REPLY)
SMB Command   =  0x72
Error class   =  0x0
Error code    =  0 (0x0)
Flags1        =  0x80
Flags2        =  0x3
Tree ID       =  0 (0x0)
Proc ID       =  1283 (0x503)
UID           =  0 (0x0)
MID           =  1 (0x1)
Word Count    =  17 (0x11)
NT1 Protocol
DialectIndex=0 (0x0)
SecMode=0x3
MaxMux=50 (0x32)
NumVcs=1 (0x1)
MaxBuffer=16644 (0x4104)
RawSize=65536 (0x10000)
SessionKey=0xA4AA
Capabilities=0x80F3FD
ServerTime=Sun Oct  1 18:00:38 2017
TimeZone=240 (0xf0)
CryptKey=Data: (1 bytes)
...

The client then says:

    SMB PACKET: SMBsesssetupX (REQUEST)
    SMB Command   =  0x73
    Error class   =  0x0
    Error code    =  0 (0x0)
    Flags1        =  0x0
    Flags2        =  0x1
    Tree ID       =  0 (0x0)
    Proc ID       =  1283 (0x503)
    UID           =  0 (0x0)
    MID           =  2 (0x2)
    Word Count    =  13 (0xd)
    Com2=0xFF
    Res1=0x0
    Off2=0 (0x0)
    MaxBuffer=16644 (0x4104)
    MaxMpx=50 (0x32)
    VcNumber=0 (0x0)
    SessionKey=0x0
    CaseInsensitivePasswordLength=24 (0x18)
    CaseSensitivePasswordLength=24 (0x18)
    Res=0x0
    Capabilities=0x80D0DC
    Pass1&Pass2&Account&Domain&OS&LanMan=
    smb_bcc=179
    ...

and finally the server:

SMB PACKET: SMBsesssetupX (REPLY)
SMB Command   =  0x73
Error class   =  0x6D
Error code    =  49152 (0xc000)
Flags1        =  0x80
Flags2        =  0x3
Tree ID       =  0 (0x0)
Proc ID       =  1283 (0x503)
UID           =  0 (0x0)
MID           =  2 (0x2)
Word Count    =  0 (0x0)
NTError = STATUS_LOGON_FAILURE
smb_bcc=0

What is going on?

Update: The way I can mount anything is by creating an account with empty password (smbpasswd -n ...) and editing smb.conf to allow null passwords.

Best Answer

My guess would be the new build has SMB1 disabled. Check the config for a line similar to: "min protocol = SMB2".

I had a similar result when I disabled SMB1 (intentionally) on my home servers. None of the Kodi media players could connect, and threw an error about authentication.