Linux – Mounting Azure Files Share

azurecifslinux

When I try to mount with the following command:

mount -v -t cifs //<storageaccount>.file.core.windows.net/<sharename> <localfolder> -o username=<myuser>,password=<storageaccountkey>,dir_mode=0777,file_mode=0777,vers=3.0

It works perfectly if I run it from an Azure Ubuntu VM or my Windows machine with the equivalent command.

Trying to run the same command on my Linux box I get the following error:

mount error(13): Permission denied

And this from dmesg:

[ 9421.865985] Status code returned 0xc0000022 STATUS_ACCESS_DENIED

[ 9421.865994] CIFS VFS: Send error in SessSetup = -13

[ 9421.866098] CIFS VFS: cifs_mount failed w/return code = -13

I have the same version of CIFS as the VM: 6.4.

I enabled SMB2-SMB3-SMB3.1.1 (experimental) in my kernel (4.4.21-gentoo).

I have samba installed as well (and it doesn't work with smbclient either) but it is my understanding they are unrelated.

Best Answer

Unfortunately, you can't yet. Atm only Windows 8, 10 and Window Server 2012 (R2) are supported if mounting outside Azure Datacenter.

The Linux SMB client doesn’t yet support encryption, so mounting a file share from Linux still requires that the client be in the same Azure region as the file share. However, encryption support for Linux is on the roadmap of Linux developers responsible for SMB functionality. Linux distributions that support encryption in the future will be able to mount an Azure File share from anywhere as well.

More Info:

https://azure.microsoft.com/en-us/documentation/articles/storage-how-to-use-files-linux/#overview