mount_smbfs -N option not working

Status
Not open for further replies.

toadman

Guru
Joined
Jun 4, 2013
Messages
619
I'm getting the following error when trying to use the -N option with mount_smbfs from the freenas server (which is the client in this case) to a cifs share on another server:

Code:
backupserver# mount_smbfs -N -I 192.168.10.10 //someusername@fileserver/userdata /mnt/userdata
mount_smbfs: unable to open connection: syserr = Authentication error


I've got the password in the /root/.nsmbrc and am running the command as root.

The same command without the -N options works fine, and prompts for a password. And it will mount the share properly.

I can't tell if it's finding the .nsmbrc file or not? Contents of that file are:

Code:
[fileserver]
addr=192.168.10.10

[fileserver:someusername]
password=userspassword


Anyone else experience this? And if so, any solutions?
 
Last edited:

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Are you trying to do this on the FreeNAS server or some linux system?
 

toadman

Guru
Joined
Jun 4, 2013
Messages
619
Trying to mount a cifs share from another server with my freenas server, i.e. Freenas is the client in this case. (Updated original post to make it more clear.)

(There are other ways to accomplish what I'm trying to do, but it's interesting this one won't work.)
 
Last edited:

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Okay, so you're really looking for support on another OS, right?
 

toadman

Guru
Joined
Jun 4, 2013
Messages
619
No, my question is about FreeNAS. FreeNAS is the client in this case, something else is the CIFS server.

I can mount the cifs share from my freenas server (which is the CIFS client in this case) with the mount_smbfs command as root from the command line. However, I cannot mount the cifs share from my freenass server with the "mount_smbfs -N" option and I'm wondering why -N doesn't work.
 

Osiris

Contributor
Joined
Aug 15, 2013
Messages
148
Code:
vi /conf/base/etc/nsmb.conf

edit /etc/nsmb.conf directly if you want to test before reboot.
Code:
[EXTERNALSMBSERVER:USERNAMEWITHSMBACCESS]
address=10.10.0.1
password=yourPassWord

mind the capitals
 

Osiris

Contributor
Joined
Aug 15, 2013
Messages
148
One more thing, which forces me to necro this.

Upgrading FreeNas will also upgrade Samba to versions 4.5 and up.
You'll need to set
Code:
ntlm auth = yes
as an auxiliary parameter to the samba service on the server hosting the share, for those higher versions.
References in case you're unable to google:
https://forums.freebsd.org/threads/60370/
https://forums.freenas.org/index.ph...-configure-share-permissions-freenas-9.35276/
https://forums.freenas.org/index.ph...reenas-9-10-2-u2-broke-smb-permissions.51180/

Another thing. If you want to mount stuff at freenas boot, and you want to make stuff persistant over freenas upgrades, you'll need to have that nsmb.conf along with your script to copy it over the freenas one at boot.
In other words, I no longer adapt /conf/base/etc/nsmb.conf, but I just copy my nsmb.conf to /etc/ at boot.

Code:
#!/bin/sh
ms() {
		mkdir -p "$2"
		mount_smbfs -N -I "$3" -W "$4" "$1" "$2" 1>tmp.txt 2>>tmp.txt
		if grep -Fq "Authentication error" tmp.txt ; then
				echo -e "\033[1;31mMapping $1 gave an authentication error\033[0m "
		else
				echo -e "Mapped \033[1;33m$1 \033[0mto \033[1;32m$2\033[0m."
		fi
		rm tmp.txt
}
cp `dirname $0`/nsmb.conf /etc/nsmb.conf
ms //myuser@10.10.0.14/shareonothernas /mnt/maponthisnas 10.10.0.14 myworkgroup
 
Last edited:

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
Upgrading FreeNas will also upgrade Samba to versions 4.5 and up.
You'll need to set
Code:
ntlm auth = yes
as an auxiliary parameter to the samba service on the server hosting the share, for those higher versions.
No, you need to fix whatever is trying to use old, vulnerable, ancient authentication.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
This thread is about FreeBSD?

Mounting shares on FreeNAS? That, while not bad per se, sounds like the beginning of a Very Bad Idea (TM).
 

Osiris

Contributor
Joined
Aug 15, 2013
Messages
148
I'll gladly reply to your shouldaland remark.

My storage is scattered among several nasses.
It is a bad idea to use mounts, indeed, but so far it makes my sonarr-couchpotato-headphones-sab setup & collection perform.
(I'm mounting in post-install scripts, so no tampering in fstab & stuff.)

An example:
I use doublecommander in a jail to sometimes manually manage & move around my stuff.
When moving a bunch of large files around between systems and working with separate move/copy queues, this prog is excellent.
I can approach this linux prog from whatever system, using Xming in W or just directly from *nix desktops.
However, I cannot mount shares in a jail. Therefore, I cannot use the prog to move stuff between systems, unless I somehow add scp functionality in some plugin.
I'm not willing to write all that code, while I could just mount on the host, and add those mounted dirs as jail storage.
With the proper config of acls, no problems occur (these were a bitch, though).
Please tell me what approach I could have used then?

I'm in the process of trying to setup docker swarm OR openshift on my freenasses & work from there with cifs/nfs shares and then I can drop the mounts directly on the hosts.
Openshift 'requires' Centos vms, so I'm struggling with the VM system in the 11 nightlies atm, with the uefi-only crap.
btw, I have docker perfectly running on an ubuntu vm atm, and am experimenting with docker volumes on external systems.
I must admit I got a lot further with this on FN10, since vms were so easy, but I'll follow you guys beyond the abyss.
 
Status
Not open for further replies.
Top