1

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?

  • I have update my answer, please check it. – Jason Ye Jul 20 '17 at 10:38
  • Hi Jason Ye, I have also commented on your answer. I'm still not having luck getting Ubuntu 16.04 to connect, even if I disable the Secure Transfer option. Instead of Error 13, I'm getting error 115 now from external 16.04 instances. – Robert Lerner Jul 20 '17 at 18:58
0

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.

  • Just want to confirm the current situations. Please feel free to let us know if you need further assistance. – Jason Ye Jul 20 '17 at 8:23
  • This solution does not work. – lmtx Jul 20 '17 at 9:23
  • @lmtx Do you mean you have the same issue? Does this VM create from azure marketplace? – Jason Ye Jul 20 '17 at 9:32
  • yes, I have the same issue - ubuntu 16.04 with mounted azure file share; this setup worked till yesterday and suddenly stoped. vm was created from marketplace. – lmtx Jul 20 '17 at 9:36
  • @lmtx could you tell me the region and the VM size? – Jason Ye Jul 20 '17 at 9:47
0

I have the same issue at production servers. We decided to upgrade Ubuntu 16.04 LTS to Ubuntu 16.10 (I verified that mounting with secure transfer enabled works). I know that this is not easy solution but only that worked for me.

On the plus side is that upgrade from 16.04 to 16.10 is "safer" than from 16.04 to 17.04 ;)

0

Below checklist is required to mount the fileshare in Azure Linux VM

  1. It's required for the VM to be in same region where the Storage account has been created
  2. Port 445 should be open on the VM
  3. cifs-utils.x86_64 should be installed on the Linux VM to access cifs share
  4. If using RHEL 7.2 then use smb 2.1, if 7.4 and above use smb 3.0
  5. In storage account -- > go to setting --> Configuration --> Secure transfer required ---> Disable then the share has mounted in Linux vm

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.