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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create `/etc/auto.cifs`, with this variant from `auto.smb`, courtesy [howtoforge](https://www.howtoforge.com/accessing_windows_or_samba_shares_using_autofs)
```
#!/bin/bash
# $Id$
# This file must be executable to work! chmod 755!
key="$1"
# Note: create a cred file for each windows/Samba-Server in your network
# which requires password authentification. The file should contain
# exactly two lines:
# username=user
# password=*****
# Please don't use blank spaces to separate the equal sign from the
Create `/etc/auto.smb.FILESERVERNAME` with something like:
```
username=user
password=secret
```
Set permissions: `chmod 600 /etc/auto.smb.*`
edit `/etc/auto.master` to add:
```
/cifs /etc/auto.cifs --timeout=60
```
3. Fix for No DNS entries
My work network does not have a DNS entry for the file server I want. But I do
have an entry in my local `/etc/hosts` file. I tried adding a `name resolve order`
line to `/etc/samba/smb.conf` as recommended [here](https://serverfault.com/questions/609365/cifs-mount-in-fstab-succeeds-on-ip-fails-on-hostname-written-in-etc-hosts),
but it didn't work. Looking at the docs, I ended up using `dns proxy`.
```
[global]
dns proxy = yes
```
4. Reload, Restart and enable autofs
```
sudo systemctl reload autofs.service
sudo systemctl restart autofs.service
sudo systemctl enable autofs.service
```
5. Verify operation
list the directory with something like: `ls /mnt/cifs/server/share`
If things don't work, start digging into `/var/log/syslog` and `/var/log/samba/log*`
(use `ls -lrt` to find the most recently changed logs).
running `automount -f -v` instead of with systemctl can be helpful
Running `smbclient -L server -d 256` can be helpful. Using `smbclient -L server -m SMBx`
was key for me solving the [Mount CIFS Host is down](https://serverfault.com/questions/414074/mount-cifs-host-is-down) problem.