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
User avatar
AndyMH
Level 21
Level 21
Posts: 13575
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Samba and Mint20

Post by AndyMH »

For info, I was bug hunting in dmesg on another problem and came across this in the output:

Code: Select all

[   45.197968] CIFS: Attempting to mount //diskstation.local/home/
[   45.198008] No dialect specified on mount. Default has changed to a more secure dialect, SMB2.1 or later (e.g. SMB3), from CIFS (SMB1). To use the less secure SMB1 dialect to access old servers which do not support SMB3 (or SMB2.1) specify vers=1.0 on mount.
When I first upgraded to LM20 I followed altair4's advice and modified smb.conf to add:

Code: Select all

client min protocol = NT1
server min protocol = NT1
to get it to work. Relevant entry in fstab (version not defined):

Code: Select all

#diskstation mounting under cifs
//diskstation.local/home/	/media/synology	cifs	credentials=/etc/samba/credentials,uid=1000,gid=1000,nofail	0	0
I had glibly assumed it would be connecting with SMB1, but no, it is connecting with a later version. Obvious in retrospect, you are setting the minimum protocol in smb.conf.
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: 11427
Joined: Tue Feb 03, 2009 10:27 am

Re: Samba and Mint20

Post by altair4 »

mount.cifs is Linux Kernel based. It knows nothing about samba on the client side. It doesn't even know smb.conf exists so any changes you make to smb.conf to control how the samba client operates are ignored by CIFS.

The cifs equivalent to "client min protocol" is to set the vers operand. So if your server only runs with SMBv1 or an SMBv2 version less than 2.1 you would need to add something like vers=1.0 or vers=2.0 to the cifs mount statement in fstab.
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: 13575
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Samba and Mint20

Post by AndyMH »

Each day I learn a little more :) thanks.

So what does need the changes in smb.conf? The only other way I access remote devices is through nemo, getting at the diskstation with smb://diskstation.local in nemo or also in nemo browsing for my other mint PCs* via network:///

* the Public folder is shared on all my mint boxes.
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: 11427
Joined: Tue Feb 03, 2009 10:27 am

Re: Samba and Mint20

Post by altair4 »

Nemo or any other Linux file manager except maybe Dolphin calls gvfs ( gio ) which in turn calls a samba client library ( libsmbclient ). That samba client library does reference smb.conf for guidance on how to operate.

Why are there two completely independent mechanisms - one Linux kernel based the other samba based - available to access a SMB / Samba share? I do not know.

It could be that since Linux is still thought of as a Server OS it would make sense to have a kernel based approach so that it could be mounted in a traditional way to the local file system.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
Bronze Globe
Level 3
Level 3
Posts: 167
Joined: Wed Dec 14, 2016 1:27 am

Re: Samba and Mint20

Post by Bronze Globe »

altair4 wrote: Fri Jun 19, 2020 8:30 am
[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.
Thanks for this! Had trouble connecting to a samba share with apps on my Wii, such as WiiMC and WiiXplorer. The old force user = username thing I used on Mint 17.3 didn't have much effect this time.
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 »

I think kernel 5.15 has smb3 resolved. Haven't tested it yet
HP EILITE FOLIO 9470M i7-3667u x 4
GitHub: tolgaerok
Image Image
taltamir
Level 1
Level 1
Posts: 35
Joined: Sun Jul 24, 2022 6:36 pm

Re: Samba and Mint20

Post by taltamir »

senjoz wrote: Mon Aug 10, 2020 10:14 am 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
wsdd is great, it should be integrated into samba. and until then it really should be included in the main post of this thread.
I spent far too much time trying to fix this, and getting wrong instruction after wrong instruction before stumbling unto wsdd

I also updated the install instructions for latest mint:
1. import the security key for that repository

Code: Select all

sudo apt-key adv --fetch-keys https://pkg.ltec.ch/public/conf/ltec-ag.gpg.key
2. find out your distro, which is the codename for your version of debian. Debian uses codenames for various versions such as buster or bullseye. If you are unsure what your distro is you can find out in debian by using

Code: Select all

lsb_release -cs
In Ubuntu or Mint, if you are using an up to date version, you will just want to use the latest version. Go to https://www.debian.org/download to locate the latest codename for debian. You can double check that this codename appears here https://pkg.ltec.ch/public/dists/ and if it does not find the latest codename that does.

as of 2022-07-25 the latest is codename bullseye

3. add the repository to /etc/apt/sources.list.d with a file containing the following line deb https://pkg.ltec.ch/public/ DISTRO main replacing DISTRO with the codename of your Debian distro.

in mint you can do this via GUI: menu > administration > software sources > additional repositories > add

4. refresh available packages via

Code: Select all

apt update
5. install wsdd via

Code: Select all

apt install wsdd
6. optionally you can configure wsdd via changing /etc/wsdd.conf.
After looking over it all, I just left that file blank and it just worked on all my windows machines.

7. run wsdd via

Code: Select all

sudo systemctl start wsdd
altair4
Level 20
Level 20
Posts: 11427
Joined: Tue Feb 03, 2009 10:27 am

Re: Samba and Mint20

Post by altair4 »

1st: WSDD is mentioned in this post. It's item 3.

2nd: The instructions for Mint21 will be far simpler and much more reliable than the roll your own implementation:
Share Folders using Samba in Home Network with Mint 21

Short version:

Code: Select all

sudo apt install wsdd
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
taltamir
Level 1
Level 1
Posts: 35
Joined: Sun Jul 24, 2022 6:36 pm

Re: Samba and Mint20

Post by taltamir »

altair4 wrote: Mon Jul 25, 2022 3:22 pm 1st: WSDD is mentioned in this post. It's item 3.

2nd: The instructions for Mint21 will be far simpler and much more reliable than the roll your own implementation:
Share Folders using Samba in Home Network with Mint 21

Short version:

Code: Select all

sudo apt install wsdd
thanks. yea that sounds fantastic.
SteveR
Level 3
Level 3
Posts: 166
Joined: Fri May 24, 2019 12:02 pm
Location: Morehead City, NC
Contact:

Re: Samba and Mint20

Post by SteveR »

In June 2022 an update to Mint 20.3 affected Samba. This was reported in Problem after samba update. In August 2022 another update to Mint 20.3 fixed the Samba issue ("Unable to mount location Failed to retrieve share list from server: No such file or directory") :D
As of this posting, I have not yet updated to Mint 21.
User avatar
SMG
Level 25
Level 25
Posts: 31328
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: Samba and Mint20

Post by SMG »

Moderator note: PapaBear502's issue can now be found here Problems with Samba and Mint20 because as indicated at the top in the pink box, "Don't add support questions to tutorials please; start your own topic in the appropriate sub-forum instead."
Image
A woman typing on a laptop with LM20.3 Cinnamon.
Slybo
Level 1
Level 1
Posts: 1
Joined: Thu Dec 21, 2023 2:42 pm

Re: Samba and Mint20

Post by Slybo »

altair4 wrote: Reinstate smb1 on the client side of Mint:

Edit /etc/samba/smb.conf and right under the workgroup = WORKGROUP line add:
client min protocol = NT1
client lanman auth = yes
client ntlmv2 auth = no
server min protocol = NT1
ntlm auth = Yes

Then reboot your box.
THANK YOU!
I couldn't connect to my 2 NAS drives. This fixed my problem.
Post Reply

Return to “Tutorials”