This page looks best with JavaScript enabled

Import directory via SSH-fs

 ·  🎃 kr0m

Secure Shell FileSystem (SSHFS) is a file system capable of importing remote directories by encrypting traffic through ssh. It is based on fuse, so it will be slower than a traditional file system and if we also take into account the network latency, it can lose a lot of performance. However, under normal conditions and if we do not have special requirements, it works quite decently.

To be able to use fuse, we must have a kernel compiled with support for it, the option to enable is:

File systems ---> FUSE (Filesystem in Userspace) support

We install the necessary software:

emerge -av sys-fs/sshfs-fuse

We mount the remote directory:

mkdir /mnt/sshfs
sshfs root@IP_SERVER:/root /mnt/sshfs

Now we can access the contents of the remote directory in /mnt/sshfs as if it were a local directory ;)

In fact, we can see the space of the directory using df:

root@A.B.C.D :/root 36800892 27247496 7660960 79% /mnt/sshfs

We unmount the directory:

umount /mnt/sshfs

This is a way to access a remote directory easily and securely without the need to install additional software since, being a server, ssh will be almost mandatory.

If you liked the article, you can treat me to a RedBull here