Skip to content

Instantly share code, notes, and snippets.

@alietz
Created May 21, 2026 07:09
Show Gist options
  • Select an option

  • Save alietz/6df3060a7078e0e7ee6c90f3b55512d9 to your computer and use it in GitHub Desktop.

Select an option

Save alietz/6df3060a7078e0e7ee6c90f3b55512d9 to your computer and use it in GitHub Desktop.
Mounting an SMB volume with autofs

Our demo share

Windows server demoserver
Share demoshare
Mount path on the FileMaker server /mnt/demoserver

Install the Ubuntu packages

apt-get install autofs cifs-utils

Create the mount point

sudo mkdir /mnt/demoserver
sudo chmod 700 /mnt/demoserver
sudo chown fmserver:fmsadmin /mnt/demoserver

Get the fmserver user uid / gid

We need this for the automount file in the next step

id -u fmserver
id -g fmserver

For this demo, I assume the user id is 1001 and the group id is 1002.

Configure the mount

Add this line to /etc/auto.master

/mnt/demoserver /etc/auto.demoserver --timeout=600 --ghost

Create the automount file

Create the file /etc/auto.demoserver

# Automatically mount the demoserver share
# autofs uses the ticket cache in /tmp/krb5cc_0

demoshare -fstype=cifs,vers=3.0,sec=krb5,cruid=0,uid=1001,gid=1002 ://demoserver/demoshare

Start autofs and make it start automatically on reboot

sudo systemctl enable autofs
sudo systemctl start autofs

Use the file share

cd /mnt/demoserver/demoshare
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment