69°F

Aaron Parecki

  • Articles
  • Notes
  • Photos
  • SSHfs on OS X via Samba

    November 20, 2008

    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.

    Thu, Nov 20, 2008 11:39am -08:00
Posted in /articles

Hi, I'm Aaron Parecki, Director of Identity Standards at Okta, and co-founder of IndieWebCamp. I maintain oauth.net, write and consult about OAuth, and participate in the OAuth Working Group at the IETF. I also help people learn about video production and livestreaming. (detailed bio)

I've been tracking my location since 2008 and I wrote 100 songs in 100 days. I've spoken at conferences around the world about owning your data, OAuth, quantified self, and explained why R is a vowel. Read more.

  • Director of Identity Standards at Okta
  • IndieWebCamp Founder
  • OAuth WG Editor
  • OpenID Board Member

  • 🎥 YouTube Tutorials and Reviews
  • 🏠 We're building a triplex!
  • ⭐️ Life Stack
  • ⚙️ Home Automation
  • All
  • Articles
  • Bookmarks
  • Notes
  • Photos
  • Replies
  • Reviews
  • Trips
  • Videos
  • Contact
© 1999-2025 by Aaron Parecki. Powered by p3k. This site supports Webmention.
Except where otherwise noted, text content on this site is licensed under a Creative Commons Attribution 3.0 License.
IndieWebCamp Microformats Webmention W3C HTML5 Creative Commons
WeChat ID
aaronpk_tv