MacOS – How to get automount and sshfs (osxfuse) working with yosemite

automountmacosNetworkssh

I'm currently trying to get Apple's automount working with osxfuse and sshfs.
The result should be that a specified folder gets automatically mounted if it is used.

What I've done so far:

  • installed osxfuse and sshfs from the official packages
    (versions are osxfuse: 2.7.3 / sshfs 2.5.0)
  • created a symlink /sbin/mount_sshfs -> /usr/local/bin/sshfs
  • appended the following config line to /etc/auto_master : /- auto_ssh -nosuid
  • created the /etc/auto_ssh config file:

    /mnt -fstype=sshfs,sshfs_debug,allow_other,idmap=user,follow_symlinks,max_read=65536,rw,nodev,cache=no,IdentityFile=/Users/myUsername/.ssh/sshfs remoteUser@remoteHost:/path/to/folder
    
  • afterwards reload automount via : sudo automount -cv

If I now try to cd into mnt i get the following error:

bash: cd: /mnt: Operation not permitted

The console contains the following:

04/12/14 01:27:50,418 automountd[1965]: MOUNT  REQUEST: name=/mnt [] map=auto_ssh opts=nosuid path=/mnt direct=1
04/12/14 01:27:50,631 KernelEventAgent[69]: tid 54485244 received event(s) VQ_DEAD (32)
04/12/14 01:27:50,632 automountd[1965]: MOUNT  REPLY  : status=1, AUTOFS_DONE
04/12/14 01:27:50,632 automountd[1965]: mount of /mnt failed: Operation not permitted

Does anyone have any idea how to make this work, or what to try next?

Best Answer

FWIW, if anyone else stumbles across this old question, the best guide I have found for mounting sshfs using apple's automounter is here -

http://virtuallyhyper.com/2013/07/mount-various-file-system-with-autofs-on-mac-os-x-mountain-lion/#mount-sshfs-with-autofs