5

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.

Vivek Rai
  • 862
  • 1
  • 8
  • 22
  • 1
    This doesn't seem like a programming question, it would be more appropriate on [su] or [apple.se]. – Barmar Apr 04 '20 at 08:02

1 Answers1

4

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.

  • 1
    Thanks for the answer. I should have mentioned that I did put `mount_sshfs` in `/sbin` later after disabling SIP, but that did not help either. Perhaps, it is the launchDaemon component that I'm missing.. will let you know how it goes. – Vivek Rai Apr 05 '20 at 12:05
  • 1
    Indeed, it looks like the only bit left was adding the kernel extension. That did the trick. Thanks! Now off to struggling with osxfuse bugs.. – Vivek Rai Apr 06 '20 at 18:30