Why, you ask?
Because sshfs on OSX's version of sshfs is wonky.
My solution is to use an intermediate linux server which does the sshfs mount, then serves that to os x over a samba share. Another benefit to this is that you only need one samba share to mount all your sshfs connections, since the linux server will be taking care of those. Also if you had a windows computer you wanted to use this with, it would also be able to mount the samba share from the linux server.
Let's get started.
I ran into a couple tricky config issues while setting this up. This post is here mostly for me to remember them for next time I need to do them. If anybody else happens to stumble across this and finds it useful, then that's a bonus.
On the linux server, you'll need to install fuse-sshfs as well as samba. In Fedora, this can be done like so:
$ yum install samba
$ yum install fuse-sshfs
You need to add the linux user to the fuse group, and create a samba user account.
$ usermod -a -G fuse aaron
$ smbpasswd -a aaron
Here's something that isn't normally covered in fuse tutorials. In order to allow samba to access the fuse mount, you need to create a file, /etc/fuse.conf with the following contents:
user_allow_other
If you don't do that, the mounted folder just disappears from the samba share.
You need to make some changes to /etc/samba/smb.conf file in order for symlinks to be shared to os x. I'm not sure if this is required for fuse to work, but it's nice to have anyway:
unix extensions = no (add this outside of a share definition)
follow symlinks = yes (add this inside a share definition)
Of course, you need to configure the firewall to allow access to samba, (tcp and udp ports 445, 137, 138, 139 should do). And, you'll need to make sure samba starts when the machine boots.
$ chkconfig smb on
We're almost there.
To actually mount the sshfs folder, you'll run a command which looks something like this. Note the extra option at the end:
sshfs username@example.com:/home/username mount_target -o allow_other
Now you can mount your home folder on the linux server over samba, and you'll see a folder mount_target, which is the sshfs mount.
Note: you'll probably want to set up your ssh server with public key authentication so you don't have to enter your password every time you connect. This is not the topic of this post, so I won't bother mentioning how. There's plenty of other tutorials on the Internet.
I hope this covers it, but feel free to comment if I've left anything out.