Learning How to Mount an SFTP Directory Using Rclone
Since the beginning of my web dev journey, I’ve been using FileZilla as my primary SFTP client for two huge reasons. Number one, it’s available cross-platform and Linux is one of those platforms. Number two, it’s available at a really good price: free.
Over the last few years, it’s been working great for me. A few years back, I made the transition to Manjaro and have been relying almost exclusively on the AUR for most of my software needs. That’s been going great until the latest FileZilla update. For whatever reason, it broke, and I haven’t had time to go on a side quest to get it working again.
Against a wall
Unfortunately, at the time of this writing, I was trying to use FileZilla compiled from the default package manager in Manjaro and it was having trouble launching. When I tried executing filezilla
from the terminal, I got an error saying that it couldn’t find some gtk3_aui
package and pacman
didn’t know what I was talking about either, so I needed a quick open source alternative to FileZilla until it got fixed.
Luckily, I remembered that I could use rclone
to mount Backblaze B2 buckets on my file system just like a normal external hard drive. I figured sense rclone
works with every file-serving platform and protocol out there, I’d give it a shot.
Setup
Setup was pretty straightforward, just run rclone config
and choose your cloud service. For me, this time, it was SFTP. It took me through quite a bit of options since SFTP is a bit more open than a proprietary service like Backblaze’s B2 buckets. Once I went through all the options, set passwords, ports, hostname, username, it was all set up and good to go, I could call it like I’d call any other rclone
connection.
Mount
Once you’re set up, the mounting is pretty easy for Linux and Mac users. Just run the mount command and tell rclone
where to mount your destination. So for example, back when I was setting up my rclone cofig
, my SFTP was named SHC
. So to mount the root directory of my web server to someplace on my local machine and use it just like an external drive, just run rclone mount SHC:/ /path/to/local/dir/
. For more info, feel free to check out the Rclone docs and see what else you can do with Rclone.