put in the [global] section of /etc/samba/smb.conf the directive
min protocol = NT1
samba calls SMB1 as NT1.
Answer from Cosmin Miron on Stack Overflowwindows ce - How to enable SMB1 as default and disable SMB2 and SMB3 on Ubuntu 18.04 Server? - Stack Overflow
security - How can I enable Samba 1 authentication for a single share? - Unix & Linux Stack Exchange
Mageia forum • View topic - [SOLVED] Can't connect to Samba share
Upgraded to Mint 20 - can't mount NAS folders
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:
- 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.
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:

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.