3

I've upgraded to Ubuntu 18.04 and I can't connect to Windows10 SMB share. Here below what I did / tested:

  1. Using default Files app I tried to connect using smb://[user]@IP I had the dialog asking for the password and after typing it, I've got: "Unable to access location: Failed to retrieve share list from server: Connection timed out.

  2. Using a terminal, smbclient -L 192.168.0.100 (that's the IP of my WIN10 PC), I've got the correct list of the shares available on that system.

  3. sudo ufw app list -> shows Samba as allowed app.

It seems the smbclient is able to get the share list from Win10 system but the default Files app doesn't... I don't really know how to continue this analysis. Did you encouter similar issue? Kind regards, superauto

2 Answers 2

2

It's a bug: https://bugs.launchpad.net/gvfs/+bug/1828107

It's actually a bug that was created when they tried to fix another bug: https://bugs.launchpad.net/ubuntu/+source/gvfs/+bug/1778322

In short: Browsing for smb hosts relies on the smb1 dialect to do the discovery. But the samba client is designed to go all the way up to smb3 and when it does host discovery doesn't work. They tried to fix that by forcing the file manager down to smb1 to do the discovery but then it gets stuck there.

Windows 10 disables smb1 on the server side so access is impossible. smbclient works because to can use the defaults and access Win10 via smb3.

So there are really only 2 workarounds for this problem:

Force Win10 back to smb1 on the server side which Microsoft does not recommend.

Or do a cifs mount of each individual share which will by default use a more current smb dialect. Something like this:

sudo mount -t cifs //192.168.0.100/share-name /mount-point -o username=username,password=some-password,uid=your-ubuntu-user-name

You can set this up in /etc/fstab - with a different syntax - if you choose to go this route.

EDIT: For the credentials in plain text issue you can create a credentials file and make it accessible only to root:

[1] Create a file say at /etc/samba/credentials

[2] Make it accessible only to root: sudo chmod 0600 /etc/samba/credentials

[3] Then add your credentials to it in this form:

username=user-name
password=user-password

Then an fstab statement would look something like this:

//192.168.0.100/share-name /mount-point cifs credentials=/etc/samba/credentials,uid=your-ubuntu-user-name 0 0
4
  • Thank you very much for your hint. I've made some testing and yes, mounting with cifs is working. What I don't like is the need to put the password in clear text somewhere but that's OK in a small network. I will do the setup in fstab but I suppose I will have to do that for any user on that machine, isn't it? fstab is per user feature?
    – panda
    Oct 10, 2019 at 21:12
  • I edited my answer to show how you can use a credentials file instead of having it in plain text in fstab.
    – Morbius1
    Oct 10, 2019 at 21:59
  • For the multiple users question: multiple users on the same client machine? Is the share in the Win10 machine allow full read / write access to anyone with the right username and password?
    – Morbius1
    Oct 10, 2019 at 22:01
  • If it is you could do something like this: ubuntuforums.org/…
    – Morbius1
    Oct 10, 2019 at 22:12
0

I have this problem and able to fix this with Windows 10 and Ubuntu 20.04 Focal Fossa without installing SMB v1 or change the regedit. There are few things need to be changed in /etc/samba/smb.conf

   passdb backend = tdbsam
   security = user

Change the networking

#### Networking ####

# The specific set of interfaces / networks to bind to
# This can be either the interface name or an IP address/netmask;
# interface names are normally preferred
interfaces = 192.168.100.63 wlp1s0

bind interfaces only = yes

And change user

#map to guest = bad user
force user = username

Don't forge to add your username into smb. The detailed step with images documented over here: https://www.yodiw.com/install-samba-ubuntu-20-04-and-windows-10-sharing/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.