Samba and Mint20

Write tutorials for Linux Mint here
More tutorials on https://github.com/orgs/linuxmint/discu ... /tutorials and (archive) on https://community.linuxmint.com/tutorial
Forum rules
Don't add support questions to tutorials; start your own topic in the appropriate sub-forum instead. Before you post read forum rules
altair4
Level 20
Level 20
Posts: 11450
Joined: Tue Feb 03, 2009 10:27 am

Samba and Mint20

Post by altair4 »

Samba and Mint20
This Howto has [3] parts with a Windows 10/11 link on part [3].

Between a bug in gvfs and Sambas decision to disable SMB1 on both server and client the following problems occur:

[1] Connecting to a server that has disabled SMB1 ( Windows 10, Ubuntu 20, Mint 20, ...etc )

You will get a Failed to retrieve share list from server: error followed by one of the following:

Network dropped connection on reset. If the server is running Win10.
Invalid argument. If the server is running Linux.

There are three ways around this issue:

[1a] You could override the default setting of Samba and reinstate SMB1 ( Samba calls it NT1 ) on all your Linux machines.

Edit /etc/samba/smb.conf and right under the workgroup = WORKGROUP line add these:

Code: Select all

client min protocol = NT1
server min protocol = NT1
Then reboot your box.

You will have to do the equivalent to your Win10 box.

Or you can keep smb.conf as it is without SMB1 and do one of the following:

[1b] You can bypass the gvfs bug and connect to the server directly by name and share.

So in Connect to Server for example:

Code: Select all

smb://hostname.local/share-name
smb://host-ip-address/share-name
[1c] Bypass gvfs entirely and do a CIFS mount which is controlled by the Linux kernel and is above all this nonsense.

For example:

Code: Select all

sudo mount -t cifs -o guest,uid=1000 //hostname.local/share-name /mount-point
For more on a CIFS mount please see: Automount Samba Shares with CIFS:

mount.cifs mount will also negotiate the best smb dialect ( between SMB2.1 and SMB3 ) but it is free of the gvfs bug.
This can be set up in fstab ( with a syntax change ) so you don't have to mount it manually.

[2] Connecting to a server that only uses SMB1 - many NAS and Routers do that:

You will get an error that looks something like this:
Failed to retrieve share list from server:
Software caused connection abort


There are 2 ways around this issue:

[2a] Reinstate smb1 on the client side of Mint:

Edit /etc/samba/smb.conf and right under the workgroup = WORKGROUP line add:

Code: Select all

client min protocol = NT1
And you may need this one as well

Code: Select all

client lanman auth = yes
You may also need to add this:

Code: Select all

client ntlmv2 auth = no
Note: If you have a client to this machine and it can only access it with SMB1 you need to modify the server settings on Mint:

Code: Select all

server min protocol = NT1
ntlm auth = Yes
Then reboot your box.

[2b] OR, Use a CIFS mount - specify SMB1 ( CIFS calls it vers=1.0 ) in the mount options:

Example:

Code: Select all

sudo mount -t cifs -o guest,uid=1000,vers=1.0 //hostname.local/share-name /mount-point
OR:

Code: Select all

sudo mount -t cifs -o guest,uid=1000,vers=1.0,sec=ntlm //hostname.local/share-name /mount-point
This can be set up in fstab ( with a syntax change ) so you don't have to mount it manually.

For more on CIFS mounts please see this: viewtopic.php?f=42&t=326160

[3] Windows 10 /11 Considerations

I have a companion Tutorial that deals with Windows 10 / 11 here: Windows 10 and Samba File Sharing

Special Note: Should you decide to reset yourself back to SMB1 levels and you are using Legacy unsupported versions of Windows ( i.e. anything earlier than Win10 ) you need to follow the old NetBIOS rules: Samba Browsing Problems Checklist
Last edited by altair4 on Sun Feb 13, 2022 6:14 pm, edited 17 times in total.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
User avatar
AndyMH
Level 21
Level 21
Posts: 13704
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Samba and Mint20

Post by AndyMH »

Thank you - bookmarked!
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
altair4
Level 20
Level 20
Posts: 11450
Joined: Tue Feb 03, 2009 10:27 am

Re: Samba and Mint20

Post by altair4 »

I've rewritten this thing. It became clear I spent way too much time explaining "why" these changes happened and not enough time how to mitigate them.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
dstiles

Re: Samba and Mint20

Post by dstiles »

I assume this presupposes the presence of samba. Is there a way to effect this without samba? (And I assume NOT smb4k?)

My working methods require Thunar access to other machines and the lack of this is very annoying. Warpinator is touted as the answer and seems good at what it does, but it is not grown-up enough to replace Thunar's Network access.
altair4
Level 20
Level 20
Posts: 11450
Joined: Tue Feb 03, 2009 10:27 am

Re: Samba and Mint20

Post by altair4 »

I do not understand your post. This is a HowTo about samba so yes samba is required. You may not need or want the samba server package installed unless you want others to access your box but you will need a smb.conf present to make some of the changes described above. Since Mint installs the smbclient package by default you already have a smb.conf file.

Thunar doesn't have a "Connect to Server" option but you can use the Location Bar in thunar to do the same thing or use Gigolo.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
dstiles

Re: Samba and Mint20

Post by dstiles »

Thank you, that was the clarification I required. Sorry if I wrote it badly.
nakednorman

Re: Samba and Mint20

Post by nakednorman »

Thank you altair4 - this solved my problem connecting to an old NAS box !
dullahan

Re: Samba and Mint20

Post by dullahan »

Had to log in just to say thanks. The first suggestion of adding
client min protocol = NT1
server min protocol = NT1

fixed my issue on a newly converted mint 20 computer.

Slowly but surely all my computers are being converted to mint machines.
User avatar
senjoz
Level 5
Level 5
Posts: 900
Joined: Tue Jun 09, 2020 3:55 am
Location: Kamnik

Re: Samba and Mint20

Post by senjoz »

SMB1 protocol is very old and vulnerable. I would rather not use it. My opinion is that the device that can communicate only over SMB1 is for discard.

Regards,
Jože
SteveR
Level 3
Level 3
Posts: 167
Joined: Fri May 24, 2019 12:02 pm
Location: Morehead City, NC
Contact:

Re: Samba and Mint20

Post by SteveR »

  1. A very very big thank-you to altair4 for providing this tutorial/solution. The tutorial was very informative and provided the solution I needed following my upgrade to Mint 20.
  2. The SMB1 protocol may be very old and vulnerable. The question arises as to whether those supporting SAMBA will be updating the program to incorporate a current secure protocol that works under Linux.
  3. Warpinator is an excellent addition to Mint for file sharing.
User avatar
AndyMH
Level 21
Level 21
Posts: 13704
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Samba and Mint20

Post by AndyMH »

SteveR wrote: Wed Jul 22, 2020 3:15 pm
  1. A very very big thank-you to altair4 for providing this tutorial/solution.
altair4 is the 'goto' person on this forum for anything samba. He has helped me out more than once in the past and the efforts are really appreciated. I may have said this before, but it is worth repeating.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
altair4
Level 20
Level 20
Posts: 11450
Joined: Tue Feb 03, 2009 10:27 am

Re: Samba and Mint20

Post by altair4 »

SteveR wrote: Wed Jul 22, 2020 3:15 pm The SMB1 protocol may be very old and vulnerable. The question arises as to whether those supporting SAMBA will be updating the program to incorporate a current secure protocol that works under Linux.
I have rewritten this HowTo once and it looks like I need to do it again.

Options [1a], [1b], and [1c] are meant to be logical OR's. You can do [1a] if you want. But you can opt to keep smb.conf as it is where SMB1 is diabled and do [1b] or [1c] which will then access your servers with an smb dialect somewhere between SMB2.02 and SMB3.11 - it's a negotiated process between client and server.

To be sure if your other machine is running an operating system that went end-of-life 11 years ago like WinXP you are pretty much hosed ( a sysadmin term ). You are going to have to dumb down your Linux box quite a bit to work with something like that.

Just to be clear, this is not a samba issue this is a "discovery then access" issue. Although Linux is hampered with a buggy gvfsd-smb-browse process that made things worse it is not alone in this. Any operating system that disables smb1 will have this issue.

I run Windows 10 the way Microsoft wants me to run it with smb1 disabled. Win10 cannot "see" my Ubuntu server if I browse for it ( at least not without WSD ). MacOS can not "see" my Win10 box in Finder. In all cases I can connect to these machines if I ask for it explicitly (\\ubuntuserver.local in Windows, smb://win10.local/share in Linux or MacOS ) and when I do that it will be with an smb dialect greater than smb1.



Thanks AndyMH, you're my biggest only fan.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
User avatar
ibm450
Level 5
Level 5
Posts: 650
Joined: Sun Jan 11, 2009 6:56 am
Location: Hamilton Hill, Western Australia

Re: Samba and Mint20

Post by ibm450 »

forgive my lack of understanding.
Could someone please explain what i add into this line and whether its done once via terminal?

Code: Select all

sudo mount -t cifs -o guest,uid=1000 //hostname.local/share-name /mount-point
so, am i right to say:

Code: Select all

sudo mount -t cifs -o guest,uid=1000 //Windows10.local/downloads /mount-point
and what am i missing for the mount-point? where do i get that info from

thanks in advance
HP EILITE FOLIO 9470M i7-3667u x 4
GitHub: tolgaerok
Image Image
User avatar
senjoz
Level 5
Level 5
Posts: 900
Joined: Tue Jun 09, 2020 3:55 am
Location: Kamnik

Re: Samba and Mint20

Post by senjoz »

I would like to draw your attention on wsdd daemon, https://github.com/christgau/wsdd . It implements a Web Service Discovery host daemon on Linux. I configured it a few months ago on LM 19.3 machines, before upgrading to LM 20. I cannot remember exactly how I did it, but it functioned. In LM 20 I did not configure it because I do not use Windows 10 alot at the moment.

Regards,
Jože
altair4
Level 20
Level 20
Posts: 11450
Joined: Tue Feb 03, 2009 10:27 am

Re: Samba and Mint20

Post by altair4 »

Another topic .. another Howto: [Part 1b] WSD = WS-Discovery
Posted that a while ago.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
User avatar
senjoz
Level 5
Level 5
Posts: 900
Joined: Tue Jun 09, 2020 3:55 am
Location: Kamnik

Re: Samba and Mint20

Post by senjoz »

altair4 wrote: Mon Aug 10, 2020 1:11 pm Another topic .. another Howto: [Part 1b] WSD = WS-Discovery
Posted that a while ago.
Really 5 years ago? I did not know that that thing is so old.

Regards,
Jože
altair4
Level 20
Level 20
Posts: 11450
Joined: Tue Feb 03, 2009 10:27 am

Re: Samba and Mint20

Post by altair4 »

I constantly update my tutorials ... well ... most of them. I think I added that to the original 2 maybe 3 years ago.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
User avatar
ibm450
Level 5
Level 5
Posts: 650
Joined: Sun Jan 11, 2009 6:56 am
Location: Hamilton Hill, Western Australia

Re: Samba and Mint20

Post by ibm450 »

Hi all
My question is then, what would I enable out of the options provided?

I have w10 network and getting mint or other Linux distros to talk within the w10 network is a nightmare...

So which practice is recommended:

Nt1 variable in smb.conf, explicit seek or use of discovery service (although this linux version of ws is 5++ yrs old) ?
HP EILITE FOLIO 9470M i7-3667u x 4
GitHub: tolgaerok
Image Image
User avatar
senjoz
Level 5
Level 5
Posts: 900
Joined: Tue Jun 09, 2020 3:55 am
Location: Kamnik

Re: Samba and Mint20

Post by senjoz »

ibm450 wrote: Sat Aug 15, 2020 11:59 pm My question is then, what would I enable out of the options provided?
I would certainly not use SMB1. But that is only my opinion.

Regards,
Jože
User avatar
ibm450
Level 5
Level 5
Posts: 650
Joined: Sun Jan 11, 2009 6:56 am
Location: Hamilton Hill, Western Australia

Re: Samba and Mint20

Post by ibm450 »

senjoz wrote: Sun Aug 16, 2020 7:34 am
ibm450 wrote: Sat Aug 15, 2020 11:59 pm My question is then, what would I enable out of the options provided?
I would certainly not use SMB1. But that is only my opinion.

Regards,
Jože
oh ok.

just been experimenting and used the following in my LMDE4 smb.conf and seems to be working.

Applied the same configuration into the following distro's and had no results.
  • Mint 20
    Mx-Linux
    Ubuntu 20
Only luck im having is with lmde4

Code: Select all

[global]
        client max protocol = NT1
   	lanman auth = yes
    	ntlm auth = yes
    	usershare allow guests = yes
	hosts allow = 192.168.0.0/27 127.0.0.0/27
	hosts deny = 0.0.0.0/0
	# netbios name = LMDE4
	case sensitive = no
	browseable = yes
 	browse list = yes
	map to guest = bad user
network LMDE4.jpg
Attachments
Screenshot from 2020-08-16 19-58-29.png
HP EILITE FOLIO 9470M i7-3667u x 4
GitHub: tolgaerok
Image Image
Post Reply

Return to “Tutorials”