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
+48-1Lines changed: 48 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -189,10 +189,57 @@ When you are done using the Azure file share, you may use `sudo umount $mntPath`
189
189
> [!Note]
190
190
> The above mount command mounts with SMB 3.0. If your Linux distribution does not support SMB 3.0 with encryption or if it only supports SMB 2.1, you may only mount from an Azure VM within the same region as the storage account. To mount your Azure file share on a Linux distribution that does not support SMB 3.0 with encryption, you will need to [disable encryption in transit for the storage account](../common/storage-require-secure-transfer.md?toc=%2fazure%2fstorage%2ffiles%2ftoc.json).
191
191
192
+
### Using autofs to automatically mount the Azure file share(s)
193
+
194
+
1. **Ensure the autofs package is installed.**
195
+
196
+
The autofs package can be installed using the package manager on the Linux distribution of your choice.
197
+
198
+
On **Ubuntu** and **Debian-based** distributions, use the `apt` package manager:
199
+
```bash
200
+
sudo apt update
201
+
sudo apt install autofs
202
+
```
203
+
On **Fedora**, **Red Hat Enterprise Linux 8+**, and **CentOS 8 +**, use the `dnf` package manager:
204
+
```bash
205
+
sudo dnf install autofs
206
+
```
207
+
On older versions of **Red Hat Enterprise Linux** and **CentOS**, use the `yum` package manager:
208
+
```bash
209
+
sudo yum install autofs
210
+
```
211
+
On **openSUSE**, use the `zypper` package manager:
212
+
```bash
213
+
sudo zypper install autofs
214
+
```
215
+
2. **Create a mount point for the share(s)**:
216
+
```bash
217
+
sudo mkdir /fileshares
218
+
```
219
+
3. **Crete a new custom autofs configuration file**
220
+
```bash
221
+
sudo vi /etc/auto.fileshares
222
+
```
223
+
4. **Add the following entries to /etc/auto.fileshares**
5. **Add the following entry to /etc/auto.master**
228
+
```bash
229
+
/fileshares /etc/auto.fileshares --timeout=60
230
+
```
231
+
6. **Restart autofs**
232
+
```bash
233
+
sudo systemctl restart autofs
234
+
```
235
+
7. **Access the folder designated for the share**
236
+
```bash
237
+
cd /fileshares/$filesharename
238
+
```
192
239
## Securing Linux
193
240
In order to mount an Azure file share on Linux, port 445 must be accessible. Many organizations block port 445 because of the security risks inherent with SMB 1. SMB 1, also known as CIFS (Common Internet File System), is a legacy file system protocol included with many Linux distributions. SMB 1 is an outdated, inefficient, and most importantly insecure protocol. The good news is that Azure Files does not support SMB 1, and starting with Linux kernel version 4.18, Linux makes it possible to disable SMB 1. We always [strongly recommend](https://aka.ms/stopusingsmb1) disabling the SMB 1 on your Linux clients before using SMB file shares in production.
194
241
195
-
Starting with Linux kernel 4.18, the SMB kernel module, called `cifs`forlegacy reasons, exposes a new module parameter (often referred to as *parm* by various external documentation), called `disable_legacy_dialects`. Although introducedin Linux kernel 4.18, some vendors have backported this change to older kernels that they support. For convenience, the following table details the availability of this module parameter on common Linux distributions.
242
+
Starting with Linux kernel 4.18, the SMB kernel module, called `cifs`forlegacy reasons, exposes a new module parameter (often referred to as *parm* by various external documentations), called `disable_legacy_dialects`. Although introducedin Linux kernel 4.18, some vendors have backported this change to older kernels that they support. For convenience, the following table details the availability of this module parameter on common Linux distributions.
0 commit comments