Mounting remote shared disk broke with mint 21

Questions about Wi-Fi and other network devices, file sharing, firewalls, connection sharing etc
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Sayanel
Level 2
Level 2
Posts: 72
Joined: Wed Jun 03, 2015 2:19 pm

Mounting remote shared disk broke with mint 21

Post by Sayanel »

My router has a hard drive that is shared via a samba server. I could access it with mount.cifs under Mint 20, but that broke with Mint 21, probably due to the use of smb version 1 on the router which is deprecated and insecure. Unfortunately, I can't change that on the router side...

On client side, I tried adding "client min protocol = NT1" but it does not solve the problem.

So what could I do to mount the remote drive?

Setup:
me wrote: To debug that I used to virtual machine, one with linux mint 20 and one with linux mint 21, both blank installation with no packaged added. I'm pretty sure the virtualization do not alter the problem, as the error message I see are the same, and the diagnostic is the same : ok with mint 20, nok with mint 21. I just don't want to restart my computer 20 times to switch distros and gather logs.
Under Mint 20 blank installation, guest connection (no password) works if I force vers=1.0

Code: Select all

phil@phil-VirtualBox:~$ sudo mount.cifs //192.168.1.1/StratoCumulus test/ -o guest
mount error(2): No such file or directory
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)
phil@phil-VirtualBox:~$
phil@phil-VirtualBox:~$ sudo mount.cifs //192.168.1.1/StratoCumulus test/ -o guest,vers=1.0
phil@phil-VirtualBox:~$ cd test
## No error message, mount is successful, I have access to my files in the folder test

phil@phil-VirtualBox:~$ mount --version
mount de util-linux 2.34 (libmount 2.34.0: selinux, smack, btrfs, namespaces, assert, debug)
phil@phil-VirtualBox:~$ mount.cifs --version
mount.cifs version: 6.9

Under Mint 21 blank installation, I get "No such device or address" even when forcing version 1

Code: Select all

phil@phil-VirtualBox:~$ sudo mount.cifs //192.168.1.1/StratoCumulus test -o guest
mount error: Server abruptly closed the connection.
This can happen if the server does not support the SMB version you are trying to use.
The default SMB version recently changed from SMB1 to SMB2.1 and above. Try mounting with vers=1.0.
mount error(112): Host is down
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)
phil@phil-VirtualBox:~$
phil@phil-VirtualBox:~$ sudo mount.cifs //192.168.1.1/StratoCumulus test -o guest,vers=1.0
Retrying with upper case share name
mount error(6): No such device or address
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)

phil@phil-VirtualBox:~$ mount --version
mount de util-linux 2.37.2 (libmount 2.37.2: selinux, smack, btrfs, verity, namespaces, assert, debug)
phil@phil-VirtualBox:~$ mount.cifs --version
mount.cifs version: 6.14

with /var/log/syslog indicating

Code: Select all

Sep 28 12:53:46 phil-VirtualBox kernel: [  285.884128] CIFS: VFS: Use of the less secure dialect vers=1.0 is not recommended unless required for access to very old servers
Sep 28 12:53:46 phil-VirtualBox kernel: [  285.884140] CIFS: Attempting to mount \\192.168.1.1\STRATOCUMULUS
Sep 28 12:53:46 phil-VirtualBox kernel: [  285.903354] CIFS: VFS: \\192.168.1.1 failed to connect to IPC (rc=-6)
Sep 28 12:53:46 phil-VirtualBox kernel: [  285.907219] CIFS: VFS: cifs_mount failed w/return code = -6


About smb.conf and smbclient :
me wrote: I read multiple (but *#µ*% I can't found it now), that smb.conf is NOT required to mount a drive with CIFS. Only cifs-utils is needed.
Proof: under Ubuntu 18, samba and smbclient are not installed. "/etc/samba/" folder does not exist. With only only cifs-utils, I can connect the drive with mount.cifs (with guest and vers=1.0 option).
But it doesn't hurt, so... Under both Mint 20 and Mint 21:
By default,

Code: Select all

phil@phil-VirtualBox:~$ smbclient -L //192.168.1.1/
protocol negotiation failed: NT_STATUS_CONNECTION_DISCONNECTED
So I added "client min protocol = NT1" to /etc/samba/smb.conf and then the connection works :

Code: Select all

phil@phil-VirtualBox:~$ smbclient -L //192.168.1.1/
Enter WORKGROUP\phil's password: [left blank, no password required]

	Sharename       Type      Comment
	---------       ----      -------
	StratoCumulus   Disk      StratoCumulus
	IPC$            IPC       IPC Service (box samba 3.6.5)
Reconnecting with SMB1 for workgroup listing.

	Server               Comment
	---------            -------
	LENUAGE              box samba 3.6.5

	Workgroup            Master
	---------            -------
	WORKGROUP            LENUAGE
And I can browse my files:

Code: Select all

phil@GLaDOS:~$ smbclient //192.168.1.1/StratoCumulus
lpcfg_do_global_parameter: WARNING: The "client lanman auth" option is deprecated
Password for [WORKGROUP\phil]: [left blank, no password required]
Try "help" to get a list of possible commands.
smb: \> ls
  .                                   D        0  Sun Sep 25 18:15:20 2022
  ..                                  D        0  Thu Sep 22 19:34:27 2022
  $RECYCLE.BIN                        D        0  Sat Aug 17 16:25:33 2019
[...]
Works similar with both Mint 20 and 21.
About CIFS_ALLOW_INSECURE_LEGACY:
Samba v1 deprecation is a kernel feature, so I checked both system configuration, it seems it's enabled on both system so no problem there.

Code: Select all

phil@GLaDOS:~$ cat /boot/config-`uname -r` | grep CIFS_ALLOW_INSECURE
CONFIG_CIFS_ALLOW_INSECURE_LEGACY=y
About sec parameter:
me wrote: Under mint 20, I can connect even with sec=none:

Code: Select all

phil@phil-VirtualBox:~$ sudo mount.cifs //192.168.1.1/StratoCumulus test/ -o guest,vers=1.0
phil@phil-VirtualBox:~$ sudo umount test/
phil@phil-VirtualBox:~$ sudo mount.cifs //192.168.1.1/StratoCumulus test/ -o guest,vers=1.0,sec=ntlm
phil@phil-VirtualBox:~$ sudo umount test/
phil@phil-VirtualBox:~$ sudo mount.cifs //192.168.1.1/StratoCumulus test/ -o guest,vers=1.0,sec=ntlmv2
phil@phil-VirtualBox:~$ sudo umount test/
phil@phil-VirtualBox:~$ sudo mount.cifs //192.168.1.1/StratoCumulus test/ -o guest,vers=1.0,sec=none
phil@phil-VirtualBox:~$ sudo umount test/
all those works.

Under mint 21, sec=ntlmv2 and sec=none will result in this same error "no such device...". But sec=ntlm give "invalid argument"

Code: Select all

phil@phil-VirtualBox:~$ sudo mount.cifs //192.168.1.1/StratoCumulus test -o guest,vers=1.0
Retrying with upper case share name
mount error(6): No such device or address
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)
phil@phil-VirtualBox:~$ sudo mount.cifs //192.168.1.1/StratoCumulus test -o guest,vers=1.0,sec=ntlm
mount error(22): Invalid argument
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)
phil@phil-VirtualBox:~$ sudo mount.cifs //192.168.1.1/StratoCumulus test -o guest,vers=1.0,sec=ntlmv2
Retrying with upper case share name
mount error(6): No such device or address
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)
phil@phil-VirtualBox:~$ sudo mount.cifs //192.168.1.1/StratoCumulus test -o guest,vers=1.0,sec=none
Retrying with upper case share name
mount error(6): No such device or address
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)
I've read using ntlm could be used to solve connection to older servers...But here, I have it as "invalid argument" (same for ntlmssp). It's not a server error, it's an invalid command (we can check with wireshark: none package is exchanged, there is no try, cifs just doesn't know what ntlm is)
So far I have no other lead :
- mount.cifs using "vers=1.0" is required and is used! If it's missing, I have a message telling me to add it. If a add it, I have "No such device or address"
- Modifying /etc/samba/smb.conf doesn't seems to change anything
- Kernel legacy CIFS is enabled
- I can't enable ntlm (because invalid argument), but I'm not sure I have to...

If anyone has a lead ! Thanks

edit: Seems spoiler do not work, I used quote instead to separate a bit and organize message
Last edited by LockBot on Tue Mar 28, 2023 10:00 pm, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
d1ll1gaf
Level 1
Level 1
Posts: 2
Joined: Fri Sep 30, 2022 10:57 pm

Re: Mounting remote shared disk broke with mint 21

Post by d1ll1gaf »

I'm in the same boat as you (shares not mountable, although I can access them through the windows network share in Nemo)...

I found this on the Samba (Bug 15152) related to smb1 connections:
https://bugzilla.samba.org/show_bug.cgi?id=15152

and in the 4.15.10 version released recently (September 28th) the bug is listed as fixed, however an updated package is not yet in the LM21 repositories
Sayanel
Level 2
Level 2
Posts: 72
Joined: Wed Jun 03, 2015 2:19 pm

Re: Mounting remote shared disk broke with mint 21

Post by Sayanel »

Well this is a Samba bug, related to the share server-side, not the client side, isn't it? Samba is not required on my computer to mount the share...
I'm not sure... How do I check the samba version used from my computer?

About nemo, mounting shares with nemo uses gvfs which I found works for me. From command line, it would be

Code: Select all

gio mount smb://192.168.1.1/StratoCumulus
Then share is then mounted under /run/users/<uid>/gvfs. So it does mount, just not how I would like to.
d1ll1gaf
Level 1
Level 1
Posts: 2
Joined: Fri Sep 30, 2022 10:57 pm

Re: Mounting remote shared disk broke with mint 21

Post by d1ll1gaf »

The bug is in the libsmbclient module... So client side rather than server side is how I'm reading it, thus preventing both of us from mounting our drives how we would like
altair4
Level 20
Level 20
Posts: 11458
Joined: Tue Feb 03, 2009 10:27 am

Re: Mounting remote shared disk broke with mint 21

Post by altair4 »

Adding or removing anything in smb.conf will have no impact on mount.cifs.

mount.cifs is controlled by the Linux kernel not any samba client process. And the version of the Linux kernel you are using in Mint21 has sec=ntlm removed. The kernel can't be backward compatible forever.

Unless you want to use an earlier kernel it would appear you are out of luck.
About nemo, mounting shares with nemo uses gvfs which I found works for me. From command line, it would be
...
Then share is then mounted under /run/users/<uid>/gvfs. So it does mount, just not how I would like to.
You don't like that you have to mount it in Nemo first?

You could use Gigolo to automount the share. I wrote a HowTo on this about a century ago - I think it still works(?):
HowTo: Using Gigolo to Mount Remote Samba Shares

You could also add your gio mount statement to your Application Autostart list under Session and Startup in Settings.

Or you don't like where it mounts?
That I can't help you with.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
Sayanel
Level 2
Level 2
Posts: 72
Joined: Wed Jun 03, 2015 2:19 pm

Re: Mounting remote shared disk broke with mint 21

Post by Sayanel »

Sorry for delayed response...

I guess I will just go with a gio mount on startup.
It's not really a problem, it's just that I don't like that it's not controlled by fstab. Or that if I were on other distrib with latest kernel, I'd have to install gvfs just for mounting this.

Did someone (Cannonical?) re-implement the full samba server and client (and all other possible remote protocols) within GVFS? Why? (I don't measure the amount of work it is).
How can the connection happen if the option if deactivated in the kernel?

Also, the documentation is out of date for mint 21. "man mount.cifs" lists ntlm as a option for "sec", even if it's not available anymore.
macfanpl
Level 1
Level 1
Posts: 4
Joined: Sat Oct 23, 2021 3:07 pm

Re: Mounting remote shared disk broke with mint 21

Post by macfanpl »

Same thing here: about 10 devices ( NAS type ) working allright on Win/Mac/Arch. On Mint none are accessible.
SMB on Mint is NOT working no matter what.

Strange thing is that when I launched APW ( internal web-based file-browser accessible from NAS's web interface ), every PC/Laptop with Mint has been accessible without any problem(s). What doesnt work is way round: connection from Mint to NAS.

Ive no idea why.
Locked

Return to “Networking”