# mount_smbfs issue



## gentoobob (Sep 19, 2015)

I'm having issues mounting a domain Windows share.  I can mount it just fine on my Mac which uses a similar `mount_smbfs` as FreeBSD as far as I can tell.  I have tried every known option or setting in the command but nothing is working.  So below is the details of my Windows share detail.  Can someone tell me exactly how the format of the `mount_smbfs` should go?  I appreciate any help.  

Domain Login:  ehc\username
Server IP: 172.16.20.50
Server NetBios name:  ehcfilesvr
Server FQDN:  ehcfilesvr.ihc.domain.com    (ihc is different than the domain login above, ehc)
Share source: ehcfilesvr\folder\share
FreeBSD mount point:  /mnt/winshare

Btw, I can ping the server fine from my FreeBSD box.  When trying to run the `mount_smbfs`, two errors I get are mount_smbfs: unable to open connection: syserr = Connection refused. or mount_smbfs: empty share name


----------



## stig (Sep 19, 2015)

Hi gentoobob

I think it should be something like `mount_smbfs -I 172.16.20.50 //username@ehcfilesvr/folder/share /mnt/winshare` 

Hope it works for you 

Regards Stig


----------



## gentoobob (Sep 19, 2015)

stig said:


> Hi gentoobob
> 
> I think it should be something like `mount_smbfs -I 172.16.20.50 //username@ehcfilesvr/folder/share /mnt/winshare`
> 
> ...




Thanks Stig...I have tried that. It does not work.  It results in one of the errors.  I have also used the `-W ehc` option and for the `-I` option I have used the FQDN for the server, same errors.


----------



## stig (Sep 19, 2015)

Thanks gentoobob

I am not sure if it helps you but I have tried to replicate the error
	
	



```
mount_smbfs: empty share name
```
. I get the error response when I try to open a share on the server which does not exist. Can the name of the share be wrong or is it not shared as expected?

Regards Stig


----------



## gentoobob (Sep 19, 2015)

stig said:


> Thanks gentoobob
> 
> I am not sure if it helps you but I have tried to replicate the error
> 
> ...




No, it exist.  Its the same share/folder path that my Mac is using.


----------



## stig (Sep 20, 2015)

That is weird. 

As a last thing, I tried to connect to my test samba server with a mac. I tried two different things. 
The first I only specified the server `smb://hummingbird`, when I did this OS X gave me a choice af folders on the server. 
The second time I tried to specify a share that does not exist `smb://hummingbird/test`, this gave a timeout.

Since you don't get a time-out and OS X doesn't prompts you with a choice of folders when you connect, then the command path to the folder must be correct. 

I think the problem must be elsewhere then the command - it could be a firewall configuration issue. Which firewall are you running?


----------



## gentoobob (Sep 20, 2015)

Thanks for trying that.  I will give it a try and let you know.  I'm not running any firewalls on the laptop that has FreeBSD on it.  I pretty much use the laptop to console into my Cisco gear and I need to get to a Windows share sometimes to get a config for a particular device.  Which is why I'd like to be able to mount it.  I will give you example a try and let you know.


----------



## gentoobob (Sep 20, 2015)

Nope.  Did not work.  Just the same error.  Thanks for trying though!


----------



## gentoobob (Sep 20, 2015)

And according to some documentation I could even use the line `mount_smbfs -I "ip address" //DOMAIN;USER:pASSWORD@server/share/share /mnt/share`  and when I use that, I also get the `"empty share name"` error and it doesn't prompt me for a password.  Something is amiss.  Will keep playing with it.


----------



## rudelgurke (Sep 20, 2015)

Do you tried connecting to the Windows machine with `smbclient -L <your_win_machine>`?

Then going further with `smbclient -k //<your_win_machine_fqdn>/<Share>` to see if you can connect. Might be domain share requires Kerberos authentication, instead of the older NTLM so that means digging a bit deeper then.


----------



## gentoobob (Sep 21, 2015)

rudelgurke said:


> Do you tried connecting to the Windows machine with `smbclient -L <your_win_machine>`?
> 
> Then going further with `smbclient -k //<your_win_machine_fqdn>/<Share>` to see if you can connect. Might be domain share requires Kerberos authentication, instead of the older NTLM so that means digging a bit deeper then.



Right on.  No I hadn't tried that.  Only saw old forums that used smbclient so I didn't think it was still a valid tool.  I will give that a whirl tomorrow morning and let you know.  Thanks for that bit of info.


----------



## gentoobob (Sep 21, 2015)

Rudelgurke, I installed smbclient and it worked fine and without the `"-k"` option.  So if its not using Kerberos then I'm stumped on mount_smbfs command.  My smbclient worked with `smbclient //server/share -W DOMAIN -U USERNAME`.


----------



## Wozzeck (Sep 24, 2015)

If your network share is not full open but protected with a password.... it could be a simple problem of password storage.

mount_smbfs(8) uses primarily the password and server definitions located in /etc/nsmb.conf. Server and password must be declared as follow :



```
[SERVERNAME] => in upper case !!!!
charsets=UTF8:cp850 => (or cp437 for english us)
addr= dns name if you have setup a local name resolver of simply the IPv4 address

[SERVERNAME:USERNAME] => in upper case even if Username is recorded with mixed lower and upper case at server
password= eventually use "" quotation if your password has blank spaces
```

Note : the USERNAME and PASSWORD must match an account open in samba/windows server. You must check that root has the ownership of nsmb.conf and  that it is protected with `chmod 600`

So you should be able to simply connect with :

`mount_smbfs  //USERNAME@SERVER/share_name /mnt/mount_target_dir`

If not working, disable you firewall. Some bad rules may block the connection


----------

