How to force Nautilus to use SMB1?

Since the 18.04 upgrade, I am not able to connect to a Samba server using the Nautilus window. I have found out that I have to specify protocol to SMB1.0 (-o vers=1.0 in console). I have tried to add the following commands:

max protocol = SMB1
client max protocol = SMB1

to /etc/samba/smb.conf but it did not help, still prints Function not implemented.

Any ideas how to do this?


Disclaimer

The SMBv1 protocol is from the 1983, it is unsecure and thus disabled for a good reason. The SMBv2 protocol has been available since 2006.

Problem Description

I arrived at this question trying to find a solution for the following two problems:

  1. I have an HP printer that can only use the legacy SMBv1 protocol (HP OfficeJet Pro 8620). So my printer refused to connect to the network share and the scan to network feature stopped working.
  2. I tried to use Nautilus to browse the network shares on my own Ubuntu system. And I was getting an error with the message Unable to access location Failed to retrieve share list from server: Invalid Argument:

    enter image description here

Solution

After several attempts with different values in the /etc/samba/smb.conf file I was finally able to resolve these problems using these two values:

client min protocol = NT1
server min protocol = NT1

I also found posts that suggested to add this third parameter:

ntlm auth = ntlmv1-permitted

However, on my system this was not necessary.

Explanation

As I understand it, the client min protocol option controls how your system communicates with other SMB servers, changing this option could be useful if your Ubuntu system works as a client and you want to use SMBv1 to access a server. By default (with Samba 4.11) your local Samba installation is configured to require SMBv2 or higher connections.

On the other hand, if your Ubuntu system acts as the server that requires SMBv2 or higher and you have a remote client (such as a printer) that can only understand the legacy SMBv1 protocol, then it seems that changing the client min protocol has no effect. Instead you need to change the server min protocol. This way the client can negotiate SMBv1 with the Samba daemon running on your Ubuntu system.

Side note, you can also pass the client min protocol option to tools such as smbclient, for example:

smbclient -L //<hostname>/<folder> --option='client min protocol=NT1'

Can be used to set the client protocol to SMBv1. This was useful to test the effect of changes in the smb.conf file.

I tried this on Ubuntu 20.04 which comes with samba version 4.11. I have not tested this solution on older Ubuntu distributions.


NOTE: This answer relates to version 4.7.6 of samba and for a unique circumstance. Current versions of Samba work differently and setting client max to NT1 would make the max less than the min. To enable SMB1 ( NT1 ) on newer versions of Samba - like the one in Ubuntu 20.04 - use the answer provided by lanoxx below

client max protocol = SMB1

In an attempt to confuse as many people as possible SMB1 in samba is called NT1. So change your line to:

client max protocol = NT1

And don't add the max protocol = SMB1 line at all. If you set up a server on your 18.04 box it will negotiate the right level to use with its clients and by default the upper limit is SMB3. Has been for years.