2

I have a CentOS 7 server named server1.example.com using Samba to share /srv/samba/share. //server1.example.com/share is the path to the share. I am not able to get CentOS clients to mount //server1.example.com/share on /mnt/myShare using AutoFS.

  • AutoFS is active and running on both the CentOS clients and server.
  • Both Firewalld and Iptables are disabled on both the CentOS clients and server.
  • SELinux is disabled on both the CentOS clients and server.
  • The permissions of /srv/samba/share and /mnt/myShare are 777.
  • CentOS clients are able to mount the share as CIFS using the mount command.
  • CentOS clients are able to mount the share as CIFS using /etc/fstab.
  • CentOS clients are able to mount an NFS share using AutoFS.

The CentOS client has the following configuration.

/etc/auto.master

/mnt /etc/auto.cifs --timeout=60 --ghost

/etc/auto.cifs

myShare -fstype=cifs,username=myUsername,password=myPassword ://server1.example.com/share

The mount command shows that AutoFS wants to mount /etc/auto.cifs.

~]# mount

/etc/auto.cifs on /mnt

However, AutoFS is not mounting //server1.example.com/share on /mnt/myShare. I am unsure what needs to be done for AutoFS to mount the share on the CentOS clients.

2

It took me a few days to figure this out, so I just wanted to share the things I discovered, in case others have a hard time with AutoFS.

  • Ensure you can manually mount the share using the mount command
  • Ensure AutoFS is active and running on both the client and server.
  • In the /etc/auto.master file, ensure the first field contains the client mount point, such as /mnt.
  • Ensure the permissions of /etc/auto.your-map is -rw-r--r-- (644).
  • If using Samba and CIFS, ensure smb is active and running on the server.
  • If using NFS, ensure NFS is active and running on both the client and server.
  • If possible, disable Firewalld and Iptables on both the client and server.
  • If possible, disable SELinux on both the client and server.
  • On the client, list the mount point, which will trigger AutoFS to automount the share.
  • Add OPTION="--debug" to /etc/sysconfig/autofs to add debugging events to /var/log/messages.
  • 1
    Thanks for the detailed checklist. I'll just add that I confirmed every step but the last, and discovered that on debian-based systems you'll need to add the debug option in /etc/autofs.conf--which in my case told me that kerberos was using the wrong filename for the ticket cache (which problem is still unsolved...) – Auspex Dec 14 '18 at 11:31
0

in /etc/auto.cifs, specifying the password can lead to an auth failure (NT_STATUS_LOGON_FAILURE) if:

  • password contains $, even escaped one. The $ sign is simply removed

  • password is specified using quote '. It looks like autofs is understanding the quote as a password part

Here is my working auto.cifs file :

MOUNTNAME -fstype=cifs,rw,credentials=/root/.cifs_credentials ://SERVER_FQDN/SHARENAME

and the credentials file:

username=login

password=pass

my server is running sles12

  • I took the liberty of cleaning up the formatting a lit bit, also clipped out the "thanks" bit, we normally leave out conversational bits in answers. If you want to know more about formatting feel free to take a look in the help section: unix.stackexchange.com/editing-help – Centimane Sep 28 '17 at 12:31

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.