Summary
SSHFS lets you browse files on remote Linux PCs as smoothly as if they were on your local computer. It’s a quick and simple way to interact with headless systems like Raspberry Pi.
What is SSHFS?
SSHFS gets its name fromSecureSHell andFileSystem.
Regular SSH lets you connect to remote computers from a terminal window. Your commands are executed on the remote computer.
SSHFS is different. SSHFS mounts a remote file system on your local computer. The mounted file system appears as a normal branch of your local file system’s directory tree. You access the remote files just like any other file on your computer. you may browse through the directories and files using the cd command or a file browser.

Working with the files uses the applications on your local computer, not the remote computer. For example, editing a file uses your local editor. In fact, you’ve got access to all of your local applications, and can use them as you wish on the remote files.
SSHFS isn’t really suited to executing programs located on the remote computer. Launching an executable from the mounted file system probably won’t work well, as it will try to run on your local computer. That’s the sort of stuff best suited to a regular SSH connection. But, for working with remote files, SSHFS can’t be beat.

Installing SSHFS
To use SSHFS, SSH must already be working on the remote computer. We’ve covered how to set up SSH elsewhere. We recommendusing SSH keys instead of passwords.
If you haven’t set up SSH keys, you’ll be prompted for the password of the remote computer when you mount the file system. We’ll use passwords in our examples, so you’re able to see when the prompts appear.

If SSHFS isn’t already installed on your local computer, installing it is easy.
Fedora users need to type:
On Manjaro, you’ll use pacman:
You can test that SSHFS is installed and responding, by asking for its version number.
Making a Remote Connection
We need to create a directory to act as themount point. It’s where the remote file system will be grafted onto your directory tree.
I’m going to be connecting to a RaspberryPi that runs network scans for me, so I’m going to call my directory netscan. You could create the mount point in your home directory, but I’m going to drop it in /media/dave/, the default location for mount points in Ubuntu. You should use your own username instead of “dave.”

On other distributions, the default location might be /run/media/ or /mnt. Ultimately, you can create your mount point anywhere you like.
Let’s take a look at our new directory.
Our directory has been created, and it is owned by root. That won’t matter though, we’ll haveread and write permissionson the mounted file system.
The SSHFS command is long-ish, but fairly simple when you break it down.

The command consists of:
We’re prompted foryourpassword because you’ve used the sudo command. We’re then asked for the password for the account on theremote computer.
The first time you connect, you’ll probably be asked a yes/no question about whether you want to trust the remote computer and have its details added to your list of known SSH hosts. Answer yes to this.

Accessing Files in the Terminal Window
When you make a normal SSH connection, your command prompt changes to the command prompt of the machine you’ve connected to. That doesn’t happen when you mount a file system with SSHFS.
The only way you can tell something has happened is if you try to access the mounted file system by navigating into the mount point directory, and looking around.

We can see the home directory of the user account on the remote computer. Any changes you make here are made on the remote drive. Any edits or deletions will affect the remote computer.
We ought to be able to create a new file.
Our file is created, and we’re the owner of it. There was no need to use sudo.
We can navigate the mounted file system using cd, and we can copy files using the cp command. This effectively transfers files between the remote device and your local computer.

Accessing Files in a File Browser
Because the mounted file system looks and behaves like any other part of your file system’s directory tree, you can use your file browser to navigate it too.
The mounted file system will show up as a mounted volume. Clicking the name of the mount point takes you straight to the remote files.

Double-clicking a file opens the application associated with that file type. These actions are carried out by applications on your local computer.
If you edit a document, for example, your default local editor is launched.

Breaking the Connection
To break the connection and unmount the remote file system, we use the umount command. Note there’s no “n” before the “m” in the umount command.
The Far Away, Up Close
Having easy and direct access to files on remote computers simplifies maintenance and other tasks.
Being able to use your local applications on the remote files lets you harness the power of your full-size computer when working with devices like the RaspberryPi. For example, you may run gcc on your local machine, to compile source files on the remote machine.