automount w/ sshfs on macOS catalina

3.7k views Asked by At

I am trying to setup automount of SSH endpoints using automount and sshfs on macOS Catalina. However, it is not working and I am not sure why.

  1. /etc/auto_master
+auto_master        # Use directory service
#/net           -hosts      -nobrowse,hidefromfinder,nosuid
/home           auto_home   -nobrowse,hidefromfinder
/Network/Servers    -fstab
/-          -static
# custom; auto-mount wolverine (parker lab setup)
/-  auto_wolverine  -nosuid
  1. /etc/auto_wolverine
/System/Volumes/Data/wolverine/home -fstype=sshfs,reconnect,nodev,follow_symlinks,allow_other,StrictHostKeyChecking=no,IdentityFile=IDFILE,port=PORT,ServerAliveInterval=360,ServerAliveCountMax=3 USER@HOST:/home
  1. /etc/sythetic.conf

wolverine /System/Volumes/Data/wolverine

I also symlinked the sshfs binary to /usr/local/bin/mount_sshfs as per one of the tutorials I saw. However, when I try to open the target directory (after refreshing the mount), it says No such file or directory. Any help would be appreciated.

1

There are 1 answers

2
Carlos D. Álvaro On BEST ANSWER

The problem here is that automount tries to search mount_sshfs inside /sbin. So, although you have created that symlink, it is not available for automount.

Since macOS Catalina, /sbin is mounted as a read-only volume, so you won't be able to create the required symlink: /sbin/mount_sshfs -> /usr/local/bin/sshfs. You can find more information at Apple's support webpage.

One thing that worked for me with previous versions to macOS 10.15 Catalina was disabling System Integrity Protection and creating the required symlink from the Recovery OS partition. But I don't know if this stills work with Catalina.

You can find how to disable SIP in this document.

If you finally manage to create the symlink, you'll probably need to add the following daemon to enable the kernel extension for automount:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Disabled</key>
    <false/>
    <key>Label</key>
    <string>sysctl</string>
    <key>ProgramArguments</key>
    <array>
        <string>/bin/bash</string>
        <string>-c</string>
        <string>/Library/Filesystems/osxfuse.fs/Contents/Resources/load_osxfuse; /usr/sbin/sysctl -w vfs.generic.osxfuse.tunables.allow_other=1</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
</dict>
</plist>

Call it load.osxfusefs.tunables.plist and put it inside /Library/LaunchDaemon

You can find a very well explained guide in this answer from Apple StackExchange.