Samba Without SMB1

Write tutorials here
There are more tutorials here
Forum rules
Please don't add support questions to tutorials,start your own thread in the appropriate sub-forum instead. Before you post please read this
Post Reply
Level 20
Level 20
Posts: 10212
Joined: Tue Feb 03, 2009 10:27 am

Samba Without SMB1

Post by altair4 »

Samba Without SMB1.

Microsoft is going to remove SMB1 from future iterations of Windows 10 and Samba is considering doing the same. This is on the host side not the client side.

For the Linux Samba Client there is a problem with this. Smbclient ( which the Linux file manager uses ) and a manual CIFS mount of a samba share both default to using SMB1 only.

If you try to access the server in the file manager you will get a Failed to retrieve share list from server: Connection timed out which is not a very helpful error message because there are many causes for that message. If you run smbclient from CLI you get a better one: protocol negotiation failed: NT_STATUS_INVALID_NETWORK_RESPONSE

If you use CIFS to access your share you will get an even less helpful error message: mount error(112): Host is down

The host is not down it's just that compared to the server the Linux samba client is speaking gibberish.

So how do we fix this? There is good news and bad news:

Good News

[1] On the smbclient end you edit /etc/samba/smb.conf and add the following line - right under the workgroup = WORKGROUP line:

Code: Select all

client max protocol = SMB3
[2] On the CIFS end you add another parameter: vers - this is an example for connecting to a Win10 or Linux Samba server:
sudo mount -t cifs // /home/tester/Public -o username=smbuser,password=smbuserpw,vers=3.0
The "vers=3.0" tells cifs to use the 3.0 version of the smb dialect or SMB3.

In both cases the Linux samba client is no longer speaking gibberish.

EDIT: The 4.13 Linux Kernel changed the default CIFS SMB version from SMB1 to SMB3. THat's good since Linux, Windows, and macOS can all use SMB3 but it creates a different problem. Some devices only speak SMB1 so if you use CIFS to connect to those devices you need to add vers=1.0 to your list of cifs mount options.

Bad News

Samba client host browsing ( the Computer Browsing Service in Windows ) and SMB1 are linked. You can not have one without the other. When you set the client max protocol to anything other than SMB1 ( called NT1 in Samba ) going to Nemo > Network > Windows Network results in an empty space. Running the smbtree command also results in nothing. Host browsing is broken.

Side Notes on Changing client max protocol:

** Even though network browsing is broken host name resolution itself is not. You can still access the server machine by name but you have to do it explicitly. For example in nemo: smb://win10

** The change does not affect an avahi / samba service announcement or what samba calls multicast dns registration in newer versions of samba so you will continue to see those hosts under Network.

** The one good side affect now that the samba client is free of SMB1 is that file transfer speeds increase and loss of connectivity decreases.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
Post Reply

Return to “Tutorials”