Skip to content

Remote file system mount with sshfs

In short - when to use sshfs

If you want to browse through your remote directory (on your edge device) and copy some files here is how to do it on Linux, Windows and Mac using sshfs in the background. This way you can conveniently use your favorite file manager.

First of all you need to establish an ssh connection with qbee-connect. You will obtain a command similar to

ssh -p 12345 username@localhost
Let $PORT be the variable holding the value for the port number (here: 12345) and $USER be the variable holding the value for the user name (here: username).

Furthermore, $SOURCE_DIRECTORY holds the variable of your source directory on your remote device that you want to mount locally (e.g. the home directory /home/$USER)

Additionally, we need to specify a target directory on our local machine, where we want the remote file system to be located at. This value is stored in $TARGET_DIRECTORY (e.g. /home/local-user/mnt/my-iot-device-42/).

Hint

You can skip specifying $SOURCE_DIRECTORY if you simply want to mount your remote home directory

Linux version

Make sure you have sshfs installed, otherwise install it via your package manager (e.g. in Ubuntu use sudo apt-get install sshfs). Got to your terminal and use

sshfs -o idmap=user,port=$PORT $USER@localhost:$SOURCE_DIRECTORY $TARGET_DIRECTORY

Now you should be able to see your remote file system mounted in $TARGET_DIRECTORY which is accessible through your file manager or the command line.

Windows version

To make your FUSE file system mountable on a Windows machine, you will first have to install WinFsp and SSHFS-Win. The necessary links and installation details are provided at the official github repository. Once the packages are up and running you can either go to your command prompt and enter

net use $TARGET_DIRECTORY \\sshfs\$USER@localhost!$PORT\$SOURCE_DIRECTORY
The command prompt will ask you again to enter the username and corresponding password
Enter the user name for 'sshfs': $USER
Enter the password for sshfs: ********

Or you can go to the Windows Explorer, click on This PC and select map network drive. Using the latter method you provide the $TARGET_DIRECTORY through a UI and just have to specify the command \\sshfs\$USER@localhost!$PORT\$SOURCE_DIRECTORY. Again, we advise to follow the instructions from the official github repository.

Under Windows it makes sense to use a new drive letter for the $TARGET_DIRECTORY, e.g. X:.

Source directory in Windows

When specifying a source directory on the remote device you must use \ as a separator instead of /. Additionally, you have to specify the source directory relative to your home directory. This means specifying \home\username\sample_dir does not work, instead you have to provide sample_dir only.

Mac version

Use the same commands as for Linux but first you have to install FUSE for macOS.