Solved mount_smbfs unable to open connection: syserr = Operation timed out

Hi,

My problem is that mount_smbfs is consistently returning an error when I try to connect from FreeBSD 12.0-RELEASE-p12:

Code:
# mount_smbfs -I 10.0.0.4 -U my_user //my_user@my_host10004/Storage storage
Password:

After a while returns:
Code:
mount_smbfs: unable to open connection: syserr = Operation timed out

I have tried many permutations of this command, none worked. Including mount -t smbfs... variants.

The remote host 10.0.0.4 (my_host10004) is configured correctly, because I can connect to it from the same FreeBSD 12.0-RELEASE-p12 host using smbclient:

Code:
# smbclient -I 10.0.0.4 -U my_user //my_user@my_host10004/Storage
Enter WORKGROUP\my_user's password:
Try "help" to get a list of possible commands.
smb: \>

I can also connect to the same share from my Mac:

Code:
$ mount_smbfs //my_user@10.0.0.4/Storage storage
Password for 10.0.0.4:

( mount_smbfs //my_user@my_host10004/Storage storage also works)

I am able to access my storage from everywhere, and do not understand why mount_smbfs specifically isn't working on the FreeBSD 12.0-RELEASE-p12 host, on which smbclient works fine.

Please help me understand how to fix mount_smbfs. I have not created any config files, I've disabled the firewall to rule it out (though smbclient works), I'm able to resolve the my_host10004 hostname to 10.0.0.4 IP. I couldn't find a way to get mount_smbfs to be more verbose, how does anyone debug it?

Another FreeBSD 11.2-RELEASE system on the same network has an identical problem, but I haven't tested smbclient on it due to overwhelming evidence that the problem is with mount_smbfs.
 
Is the SMB/CIFS share on a Windows machine? Or is it a Samba too? If I'm not mistaken mount_smbfs(8) only supports SMBv1 which has been turned off by default on both Windows and Samba. If I remember correctly there was some work being done to get SMBv2 and v3 support but I'm not sure what the status of that is. But the lack of SMBv1 on the destination may be why it's not working.

I do NOT recommend turning SMBv1 back on on Windows. SMBv1 is severely broken and there is plenty of malware around that can abuse it (WannaCry is the most infamous one).
 
Thanks a lot, SirDice. The SMB/CIFS server is indeed a Windows machine (apologies for neglecting this detail), and indeed SMB 1.0/CIFS server feature is turned off.

Enabling SMB 1.0/CIFS feature (for diagnostic posterity) and rebooting the windows host did resolve the error on the FreeBSD 12.0-RELEASE-p12 host, and the share was immediately and successfully mounted.

Your recommendation is compelling, and I will keep it disabled on the Windows host for security reasons.

I'll look into what work needs to be done to add SMB v2/v3 support in mount_smbfs, but cannot make any commitments at this time.

As of this moment, this concern is resolved. I'm very grateful for your help, SirDice!
 
It is a bit of a faff but for our very legacy machines in the past we have done this:
  1. Switch to smbv1
  2. firewall your Windows server to disallow smb traffic.
  3. Allow ssh connections (built into the more recent versions of Windows (or use from OpenSSH-win32 on GitHub, bitvise, cygwin)
  4. Allow trusted users to port forward the smbv1 service in sshd.
Users can now access the smb traffic from their unix-like machines and yet many malware running on local windows machines can't really do much.
 
Back
Top