[Awesome Software NetWork] SSHFS: Allows you to mount a remote filesystem using SFTP by SSH

SSHFS

SSHFS allows you to mount a remote filesystem using SFTP. Most SSH servers support and enable this SFTP access by default, so SSHFS is very simple to use - there’s nothing to do on the server-side.

Installation

Installation requires administrative privileges.

Prior to installing, you should make sure that you can SSH with keys

macOS

Download macFUSE (dmg or pkg) and SSHFS (pkg) from Home - macFUSE - http://osxfuse.github.io

Open these dmg or pkg, run installer. Then open the Security & Privacy System Preferences when prompted

Switch to the General tab (if not already selected) and then click the button to Allow system software from developer “Benjamin Fleischer”.

Linux

SSHFS is Linux based software that needs to be installed on your local computer. On Ubuntu and Debian based systems it can be installed through apt-get.

1
$ sudo apt-get install sshfs

Usages

Create a folder in local host to access the remote filesystems (aka a mount point):

1
$ mkdir /sshfs

Mounting remote filesystems with sshfs

1
2
# sshfs username@remotehost:/full/path/to/directory /local/mount/point
sshfs [email protected]:/full/path/to/directory /Users/cloudolife/sshfs

Unmounting remote filesystems

On occasion the mount may become stuck or unresponsive you can force unmount:

1
2
3
4
5
# macOS
$ diskutil umount force /local/mount/point

# Or other OS
# $ sudo umount -f /local/mount/point

OS X (Mac) helpful hints

As of OSX 10.15 Catilina we are not recommending to create mounts in the root path or / of the file system.

To avoids local Apple Finder issues. We give the volume a name volname=userdocs (shows mount point on your desktop), add some additional options for server connections, etc. If you are using an key-based-ssh you would add it’s path to the IdentityFile paramater - adding ,IdentityFile=$HOME/.ssh/id_rsa to the end of the line.

1
$ sshfs [email protected]:/full/path/to/directory /Users/cloudolife/sshfs -o volname=userdocs,reconnect,ServerAliveInterval=15,ServerAliveCountMax=3,idmap=user,auto_xattr,dev,suid,defer_permissions,noappledouble,noapplexattr,IdentityFile=$HOME/.ssh/id_rsa

References

[1] Home - macFUSE - http://osxfuse.github.io

[2] libfuse/sshfs: A network filesystem client to connect to SSH servers - https://github.com/libfuse/sshfs

[3] faq-sshfs - https://sbgrid.org/corewiki/faq-sshfs.md

[4] How To Use SSHFS to Mount Remote File Systems Over SSH | DigitalOcean - https://www.digitalocean.com/community/tutorials/how-to-use-sshfs-to-mount-remote-file-systems-over-ssh

[5] Installing FUSE for macOS - https://library.panic.com/transmit/transmit5/fuse-install/