I'm attempting to automount a directory from a remote Ubuntu machine on my Mavericks Mac. SSHFS works perfectly when mounted manually, in many different ways. The standard sshfs mount works great:
sshfs user@desk:/home/user desk
and I can even use mount
:
sudo mount -t sshfs -o allow_other,IdentityFile=/Users/user/.ssh/nopass_id_dsa user@192.168.1.2:/home/user desk
(I followed the OSXFuse automounting instructions to set up mount_sshfs
)
I want to turn this into an automount. The easiest, recommended by OSXFuse way is to turn the above mount
command into an /etc/fstab
entry:
user@192.168.1.2:/home/user /Network/desk sshfs allow_other,IdentityFile=/Users/user/.ssh/nopass_id_dsa 0 0
but that doesn't work:
Network $ sudo mount desk
mount: desk: unknown special file or file system.
Similarly, if I do sudo automount -vc
then I either get a long timeout or an unhelpful "Operation not permitted" error when I try to enter the mount point, depending on how I play with the formatting of fstab options. I get the same errors when I try to set up an automount map, as described here.
What's wrong with my fstab entry? Or, how else can I automount sshfs on OSX?
(I'm on 10.9.5 with sshfs 2.5.0 from homebrew)
Best Answer
Due to a bug in OSXFuse, this is necessary for the allow_other flag to work:
This may or may not fix the fstab issue, but it does work with a direct map. Here's how I set mine up.
Add this line to /etc/auto_master:
create /etc/auto_ssh:
(assuming you have passwordless keys set up.)
Tell autofs about your changes:
To make the osxfuse.tunables.allow_other change survive a reboot:
Put the following in
/Library/LaunchDaemons/sysctl.plist
:Load the plist with: