Ubuntu – Mount Error 13 with Ubuntu 16.04 and Azure (Same Region)

azuremountsambaUbuntu

I am trying to mount a samba share in Azure using the connection string that they provide next to my share folder, and in 16.04 I'm getting "Mount error 13, permission denied"

The connection string, after installing cifs-utils, works exactly as I would expect it to in Ubuntu Server 17.04

Connection String:

sudo mount -t cifs //<HOSTNAME>.file.core.windows.net/<SHARENAME> /mnt/etclol -o vers=3.0,username=<HOSTNAME>,password=<PASSWORD KEY>,dir_mode=0777,file_mode=0777,sec=ntlmssp

I'm aware that there is an issue in 16.04 that prevents external connections, and connections across regions for Azure-based VMs that deals with encryption that the 16.04 kernal doesn't support. So I worked around that:

I changed my storage node from GRS (Geographically Redundant Storage) to LRS (Locally Redundant Storage) which took me from having two regions (US East and US Central) down to just US Central (the same as my web servers).

I continually get the mount error 13 when trying to mount these shares, on the same region, and inside of Azure. Every post I've looked at leads me to believe this configuration would work.

To also verify that this isn't a local mounting issue, I've tried in both a chmod'd 0777 mount, as well as directories within my home directory. I figured this didn't matter.

My only other option is migrating live 16.04 servers to 17.04, which would work, but would be quite lame.

TL;DR: Why does this not work in their proposed infrastructure hierarchy. Bonus: Is there a way to get 16.04 externally to work as well?

Best Answer

As far as I know, Ubuntu 16.04 LTS support the encryption functionality of SMB 3.0.

Maybe we can follow those steps to mount Azure file share:
1.Install cifs-utils package:

sudo apt-get update  #we should update it then install cifs-utils
sudo apt-get install cifs-utils

2.create a folder for the mount point:

mkdir mymountpoint

3.Use the mount command to mount the Azure File share:

sudo mount -t cifs //<storage-account-name>.file.core.windows.net/<share-name> ./mymountpoint -o vers=3.0,username=<storage-account-name>,password=<storage-account-key>,dir_mode=0777,file_mode=0777,serverino

More information about use Azure file storage with Linux, please refer to this link.

===========================================================
Update:
For now, Azure storage account support "Secure transfer required", this feature used for used for SMB 2.1, SMB 3.0 without encryption, and some flavors of the Linux SMB client.

By default, ubuntu 16.04 support the encryption functionality of SMB 3.0. so we should turn off Secure transfer required, and mount it direct.

Ubuntu 16.04LTS can support only password encryption for SMB – so credentials to access Azure File Storage are encrypted but the data itself is send as a clear text.

When you are using the Azure Files service, any connection without encryption fails when "Secure transfer required" is enabled. This includes scenarios using SMB 2.1, SMB 3.0 without encryption, and some flavors of the Linux SMB client. By default, the "Secure transfer required" option is disabled.

About Azure file storage with Linux, please refer to this link.

More information about Require secure transfer, please refer to this link.

Related Topic