Permanently Mapping CIFS Share in Ubuntu 16.04

Status
Not open for further replies.

briancmoses

Dabbler
Joined
Apr 19, 2014
Messages
30
I'm currently trying to permanently map CIFS shares from my FreeNAS box (version FreeNAS-11.0-RELEASE (a2dc21583)) on a Ubuntu 16.04 Server virtual machine. Just for the record, the VM host is different hardware than my FreeNAS box. So far I've pretty much followed the MountWindowsSharesPermanently guide from the Ubuntu Wiki verbatim, I've just not had very much luck so far and both my Linux-fu (crude) and Google-fu aren't helping me out.

I've tested my FreeNAS machine's shares from a different machine and they all seem to be working just fine. From a different box (Windows), I can pull up the shares in question using the same credentials without any issues.

Here's an the applicable lines from my /etc/fstab file:

//drteeth/isos /drteeth/isos cifs credentials=/root/.smbcredentials,iocharset=utf8,sec=ntlm 0 0
//drteeth/backups /drteeth/backups cifs credentials=/root/.smbcredentials,iocharset=utf8,sec=ntlm 0 0
//drteeth/homes /drteeth/homes cifs credentials=/root/.smbcredentials,iocharset=utf8,sec=ntlm 0 0
//drteeth/media /drteeth/media cifs credentials=/root/.smbcredentials,iocharset=utf8,sec=ntlm 0 0


And here's the contents of the /root/.smbcredentials file:

username=<FreeNAS share's username goes here>
password=<FreeNAS share's password goes here>


Any time I try the sudo mount -a command, this is what I get back in return:

brian@fozzie:/drteeth$ sudo mount -a
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)


Running dmesg provides a little, but not much, verbosity to the errors:

[ 4491.653814] Status code returned 0xc000006d NT_STATUS_LOGON_FAILURE
[ 4491.653842] CIFS VFS: Send error in SessSetup = -13
[ 4491.654028] CIFS VFS: cifs_mount failed w/return code = -13
[ 4491.673715] Status code returned 0xc000006d NT_STATUS_LOGON_FAILURE
[ 4491.673724] CIFS VFS: Send error in SessSetup = -13
[ 4491.673986] CIFS VFS: cifs_mount failed w/return code = -13
[ 4491.693268] Status code returned 0xc000006d NT_STATUS_LOGON_FAILURE
[ 4491.693278] CIFS VFS: Send error in SessSetup = -13
[ 4491.694946] CIFS VFS: cifs_mount failed w/return code = -13
[ 4491.712772] Status code returned 0xc000006d NT_STATUS_LOGON_FAILURE
[ 4491.712780] CIFS VFS: Send error in SessSetup = -13
[ 4491.714463] CIFS VFS: cifs_mount failed w/return code = -13


Whatever the issue is, is likely to be related to my credentials file somehow. With one of the shares, I experimented with passing the username and password right there in the /etc/fstab and that appears to work fine. But trying to use the credentials file isn't generating much luck. I've tried a few things:
  1. Deleting/recreating the file by hand to try and avoid any weird file-type or invisible characters.
  2. Updating the user's password so it's comprised of alphabetic and numeric characters only (to avoid any issues with special characters needing to be escaped out)
  3. Used chown to make sure that the root user has the ability.
  4. Moved the credentials file out of my home directory and into a directory that root owns

I'd really, really, really rather not leaving the username and password in clear text right there in /etc/fstab, can you help me figure out what's going on here?
 

diedrichg

Wizard
Joined
Dec 4, 2012
Messages
1,319
I just did this last week, and my googling found that I could add the location in fstab and it then referenced a file in a hidden directory that had the credentials in it.

I don't have that reference at hand nor the OS because I blasted it and installed another distro.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
The Ubuntu Wiki is wrong.

Drop the sec=ntlm part. NTLMv1 authentication is insecure and is disabled by default in FreeNAS now.
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
The Ubuntu Wiki is wrong.

Drop the sec=ntlm part. NTLMv1 authentication is insecure and is disabled by default in FreeNAS now.
Exactly this! This question has happens several times in the last couple weeks.

Sent from my Nexus 5X using Tapatalk
 

briancmoses

Dabbler
Joined
Apr 19, 2014
Messages
30
Wow, thanks guys. Dropping ",sec=ntlm" has resolved the issue (yay!) for 3 of the 4 shares.

I'm getting a new error in mounting my "homes" share, after my edits to /etc/fstab the homes line now looks like this:

//drteeth/homes /drteeth/homes cifs credentials=/root/.smbcredentials,iocharset=utf8 0 0

I'm now getting this back from the console after I try and sudo mount -a:

Retrying with upper case share name
mount error(6): No such device or address
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)


With dmesg saying:

[ 1414.102835] CIFS VFS: cifs_mount failed w/return code = -6

As far as I can tell, it seems to be complaining that the share doesn't exist? But I am definitely able to browse to the \\drteeth\homes share from other different computers. The homes share is configured a bit differently from the other three in FreeNAS, it has the Use as home share option set.

On a lark, I modified the /etc/fstab to be more specific. I created user-specific folders on my Ubuntu box and then tried explicitly mapping them to each of the users' folders on my FreeNAS box.

//drteeth/homes/user1 /drteeth/homes/user1 cifs credentials=/root/.smbcredentials,iocharset=utf8 0 0
//drteeth/homes/user2 /drteeth/homes/user2 cifs credentials=/root/.smbcredentials,iocharset=utf8 0 0
 

diedrichg

Wizard
Joined
Dec 4, 2012
Messages
1,319
Status
Not open for further replies.
Top