You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/storage/files/storage-how-to-use-files-linux.md
+17-16Lines changed: 17 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -78,54 +78,55 @@ ms.subservice: files
78
78
79
79
1. **[Install the cifs-utils package for your Linux distribution](#install-cifs-utils)**.
80
80
81
-
1. **Create a folder for the mount point**: A folder for a mount point can be created anywhere on the file system, but it's common convention to create this under the `/mnt` folder. For example:
81
+
1. **Create a folder for the mount point**: A folder for a mount point can be created anywhere on the file system, but it's common convention to create this under a new folder. For example, the following command creates a new directory, replace **<storage_account_name>** and **<file_share_name>** with the appropriate information for your environment:
82
82
83
83
```bash
84
-
mkdir /mnt/MyAzureFileShare
84
+
mkdir -p <storage_account_name>/<file_share_name>
85
85
```
86
86
87
-
1. **Use the mount command to mount the Azure file share**: Remember to replace `<storage-account-name>`, `<share-name>`, `<smb-version>`, `<storage-account-key>`, and `<mount-point>` with the appropriate information for your environment. If your Linux distribution supports SMB 3.0 with encryption (see [Understand SMB client requirements](#smb-client-reqs) for more information), use `3.0` for `<smb-version>`. For Linux distributions that do not support SMB 3.0 with encryption, use `2.1` for `<smb-version>`. An Azure file share can only be mounted outside of an Azure region (including on-premises or in a different Azure region) with SMB 3.0.
87
+
1. **Use the mount command to mount the Azure file share**: Remember to replace **<storage_account_name>**, **<share_name>**, **<smb_version>**, **<storage_account_key>**, and **<mount_point>** with the appropriate information for your environment. If your Linux distribution supports SMB 3.0 with encryption (see [Understand SMB client requirements](#smb-client-reqs) for more information), use **3.0** for **<smb_version>**. For Linux distributions that do not support SMB 3.0 with encryption, use **2.1** for **<smb_version>**. An Azure file share can only be mounted outside of an Azure region (including on-premises or in a different Azure region) with SMB 3.0.
88
88
89
89
```bash
90
-
sudo mount -t cifs //<storage-account-name>.file.core.windows.net/<share-name> <mount-point> -o vers=<smb-version>,username=<storage-account-name>,password=<storage-account-key>,dir_mode=0777,file_mode=0777,serverino
90
+
sudo mount -t cifs //<storage_account_name>.file.core.windows.net/<share_name> <mount_point> -o vers=<smb_version>,username=<storage_account_name>,password=<storage_account_key>,dir_mode=0777,file_mode=0777,serverino
91
91
```
92
92
93
93
> [!Note]
94
-
> When you are done using the Azure file share, you may use `sudo umount <mount-point>` to unmount the share.
94
+
> When you are done using the Azure file share, you may use `sudo umount <mount_point>` to unmount the share.
95
95
96
96
## Create a persistent mount point for the Azure file share with `/etc/fstab`
97
97
98
98
1. **[Install the cifs-utils package for your Linux distribution](#install-cifs-utils)**.
99
99
100
-
1. **Create a folder for the mount point**: A folder for a mount point can be created anywhere on the file system, but it's common convention to create this under the `/mnt` folder. Wherever you create this, note the absolute path of the folder. For example, the following command creates a new folder under `/mnt` (the path is an absolute path).
100
+
1. **Create a folder for the mount point**: A folder for a mount point can be created anywhere on the file system, but it's common convention to create this under a new folder. Wherever you create this, note the absolute path of the folder. For example, the following command creates a new directory, replace **<storage_account_name>** and **<file_share_name>** with the appropriate information for your environment.
1. **Create a credential file to store the username (the storage account name) and password (the storage account key) for the file share.**Remember to replace `<storage-account-name>` and `<storage-account-key>` with the appropriate information for your environment.
106
+
1. **Create a credential file to store the username (the storage account name) and password (the storage account key) for the file share.**Replace **<storage_account_name>** and **<storage_account_key>** with the appropriate information for your environment.
107
107
108
108
```bash
109
109
if [ !-d"/etc/smbcredentials" ];then
110
-
sudo mkdir /etc/smbcredentials
110
+
sudo mkdir /etc/smbcredentials
111
111
fi
112
-
113
-
if [ !-f"/etc/smbcredentials/<storage-account-name>.cred" ];then
1. **Change permissions on the credential file so only root can read or modify the password file.** Since the storage account key is essentially a super-administrator password for the storage account, setting the permissions on the file such that only root can access is important so that lower privilege users cannot retrieve the storage account key.
1. **Use the following command to append the following line to `/etc/fstab`**: Remember to replace `<storage-account-name>`, `<share-name>`, `<smb-version>`, and `<mount-point>` with the appropriate information foryour environment. If your Linux distribution supports SMB 3.0 with encryption (see [Understand SMB client requirements](#smb-client-reqs) for more information), use `3.0` for `<smb-version>`. For Linux distributions that do not support SMB 3.0 with encryption, use `2.1` for `<smb-version>`. An Azure file share can only be mounted outside of an Azure region (including on-premises orin a different Azure region) with SMB 3.0.
124
+
1. **Use the following command to append the following line to `/etc/fstab`**: Remember to replace **<storage_account_name>**, **<share_name>**, **<smb_version>**, and **<mount_point>** with the appropriate information foryour environment. If your Linux distribution supports SMB 3.0 with encryption (see [Understand SMB client requirements](#smb-client-reqs) for more information), use **3.0** for **<smb_version>**. For Linux distributions that do not support SMB 3.0 with encryption, use **2.1** for **<smb_version>**. An Azure file share can only be mounted outside of an Azure region (including on-premises orin a different Azure region) with SMB 3.0.
0 commit comments