Mount a remote directory via SSH on MacOS (SSHFS)
Mounting a remote directory is a very common use case. A file server provides a central place to store documents, and users can use these like a normal local folder on their laptop. Sometimes the file server is only available via SSH access. In that case, you cannot mount a share via e.g. Samba/CIFS. SCP allows to not only log on via SSH, but also to copy files. Binary files can be transferred, and this allows to use SSH access to remotely mount a directory like a file share. This is very handy for MacOS users. It is possible to mount a remote share via SSH and access the directory like a normal mounted share in Finder.
This won’t work out of the box and some external software is needed. The tool that mounts remote directory via SSH is SSHFS.
- Get the required software from the Fuse for OSX site: https://osxfuse.github.io/
- You need FUSE for macOS and SSHFS. https://github.com/osxfuse/osxfuse/releases
Install OSX Fuse
The installation wizard opens und guides you through the installation steps.
You’ll also need to allow the execution of the program. After everything is installed without error, the installation wizard ends.
After installing Fuse for OSX, you can install SSHFS.
Mount remote SSH directory
SSHFS is now operational. Open a new terminal window and run sshfs.
To mount the directory /mnt/md0 from a remote server to the local directory md0:
sshfs email@example.com:/mnt/md0/ ./md0/ -ocache=no -onolocalcaches -ovolname=ssh
sshfs firstname.lastname@example.org:/mnt/raid/md0 ./md0/
To see how the remote directory is mounted, use mount
mount_osxfuse: the file system is not available (255)
After installing Fuse for MacOS, reboot your laptop.
If a reboot is not solving a problem, it may be related to the internal smbfs module. Unload it and try to mount the directory with sshfs again.
sudo kextunload -b com.apple.filesystems.smbfs