Solved mount_smbfs refusing to mount: Connection refused

x917

New Member


Messages: 2

I can't mount a Samba share to a node using mount_smbfs. Here is the set up:

  1. FreeBSD 10.2-RELEASE running GENERIC is a guest inside a VirtualBox VM using its Bridged Adapter option. I've tried switching it to a NAT adapter but it makes no difference. The Samba version is net/samba42 (installed as a package).
  2. The Samba server is a Raspberry Pi running Arch Linux Arm and is fully up-to-date. All machines are on the same LAN and there are no firewalls between them.
  3. My other Windows and Linux boxes can connect to the Samba server without problems (well, Windows sometimes has credentials dementia...).
  4. From FreeBSD, I can connect to the Samba server from within PCManFM by typing smb://anthony@raspberry_pi/Raspberry into the address bar and filling out the credentials in the dialogue boxes that follow. I can also connect using smbclient by issuing smbclient "//raspberry_pi/RPi Home" /mnt/RPi_Home in a terminal. I can also list all of the public shares using smbclient -L raspberry_pi -U%. To me, this suggests that the Samba server isn't misconfigured.

However, no matter what permutation of mount_smbfs I use, I always seem to end up with a "Connection refused" error:

Code:
mount_smbfs -I 192.168.1.7 "//anthony@raspberry_pi/RPi Home" /mnt/RPi_Home
Password:
mount:smbfs: unable to open connection. syserr = Connection refused
I've tried including other options like -W and -U in there but it doesn't make a difference. -I seems to be mandatory though; if I leave it out then mount_smbfs will tell me that it can't find the server address. I've also tried going all-IP address (e.g., <...> -I 192.168.1.7 "//anthony@192.168.1.7<...>), to no effect.

Ultimately, my goal is to mount my shares in /etc/fstab, but I figure that if I can't get mount_smbfs to work from a terminal first, then there's no sense in trying to complicate matters.

After spending a few days reading through the relevant Handbook pages and searching through this forum and the mailing lists, I'm out of ideas. I've looked through the Samba server's logs and systemd journal, but there are no clues that I can find. So at this point I'd be appreciative of any advice or tips that I could try out.
 

metsuke

Member

Reaction score: 5
Messages: 35

Whenever I wanted to mount a Samba share as a user on a fresh install, I had to issue the following command first:
Code:
chmod 4555 /usr/sbin/mount_smbfs
It has been noted that this is insecure, but it's the only way I've found that works in my installs.
 

roddierod

Aspiring Daemon

Reaction score: 145
Messages: 833

I'm not sure if this help you guys, but I found it a week or two ago in the ports and it been working great for me sysutils/fusefs-smbnetfs.

I'm using it to mount an external hard drive (3 TB Seagate backup something or other) that is connected to my home router. This way I can use it for multiple machines and OSes and streaming content to a Roku device.
 
Last edited by a moderator:

mefizto

Well-Known Member

Reaction score: 11
Messages: 459

Hi metsuke,

thank you for the reply. Unfortunately, it did not work for me. I believe that there is other problem here; as I reported, I can connect to two Linux/GNU machines, when I try to connect to the UNIX server, dmesg(8) reports
Code:
smb-maperror:NetBIOS name is invalid
, although I have confirmed from a Windows machine that the NetBIOS name is correct.

Is there a way to contact the maintainer? A simple search reveals that I am not the only one having the problem, and it would stand to argue that net-smb36 functionality is rather important.

Hi roddierod,

thank you, but I would rather have the issue resolved, rather than installing another port if not necessary.

Kindest regards,

M
 
Last edited by a moderator:

mefizto

Well-Known Member

Reaction score: 11
Messages: 459

Hi metsuke,

Thank you for trying to help. Yes, the error is the same whether I use the reported NetBIOS name or the IP address. In addition, I have defined the relationship between the reported NetBIOS name and the IP address in the /etc/hosts.

Indeed, I can mount the Linux shares regardless of whether I use the NetBIOS name of the IP address.

I can mount the Linux shares and the UNIX shares from Linux, from UNIX, and from Windows, just not from FreeBSD.

That is, why I believe that there must be an implementation bug.

Kindest regards,

M
 

StainlessRat

New Member

Reaction score: 1
Messages: 15

If you use mount_smbfs, then you must use the file /etc/nsmb.conf:
This my file:
Code:
[default]
  workgroup=WORKGROUP
[NEMO-PC]
  addr=192.168.1.3
[NEMO-PC:AMANDA]
  password=myverylongpassword
and fstab:
Code:
//AMANDA@NEMO-PC/SHARA   /mnt   smbfs   ro,codepage=utf8   0   0
 

mefizto

Well-Known Member

Reaction score: 11
Messages: 459

Hi StainlessRat,

thank you for the reply. As I understand it, the file is not needed, because all the necessary parameters are passed in the command line. Additionally, I can connect to two different Linux machines without the file.

Nevertheless, I am so desperate to try it.

Kindest regards,

M
 

metsuke

Member

Reaction score: 5
Messages: 35

Also make sure that the user is both present in the server's system ( adduser) and samba ( pdbedit -a [username]).
 

metsuke

Member

Reaction score: 5
Messages: 35

Can you try using Samba36 instead? I have not needed to venture in to Samba42 yet, and therefore all my answers are skewed towards the wrong version. That does not mean that I don't think Samba4 should work, but at the same time, I think that if you can get Samba36 to work fine while testing, then you can also get Samba42 to work if that is the way you want to go.
 
OP
OP
x917

x917

New Member


Messages: 2

I hate to bump this old thread, but I'd like to add that I found a solution to my problem. The issue was to simply specify port 445, as such:

Code:
sudo mount_smbfs -I server_ip -W workgroup //user_on_server@server_ip:445/share_name /mount/point
If you connect over NetBIOS, try ports 137, 138, and 139. Port 445 seems to be used exclusively by CIFS.

I'm also not sure if it makes a difference, but I'm now running FreeBSD 10.3-RELEASE on bare metal whereas before I was running 10.2-RELEASE in Virtualbox.
 

tftry

New Member


Messages: 1

This is completely unsolved! Why is confusingly marked as solved?
If I'm wrong, where is the solving solution?
Thanks
 
Top