Mount remote FS locally through ssh with sshfs !

So today I was working on a parallel computing project, and used some remote machines with massive CPUs, huge amount of cores and so on. We connected to these with , and ran our code there. While doing so, we needed to update our code quite often, and doing & over and over again became quite tedious, as we wanted to iterate quickly on simple tasks.

Modifying files directly with was our first idea, and worked quite well for small changes. But when we wanted to make bigger modifications, it was just too difficult with , and we missed our good old VSCode UI.

So we looked into how we could mount the remote directory on our local computer, to be able to modify distant files outside of an session, on our laptop, and directly in VSCode. We came across this amazing article, explaining step by step how to set this up :

This totally saved our lives ! 😍

Basically, it is just a matter of doing a quick followed by on MacOS, or simply on Linux, and that's it ! You're ready to mount a remote folder using :

sshfs user@host:/remotefolder/ /localfolder
# If you have an identity file, add the following option :
# -o allow_other,defer_permissions,IdentityFile=~/.ssh/id_rsa

Beautiful, isn’t it ? Then just access the remote files at the local folder and edit them the same way you would any normal file on your laptop !

When you wish to close the connection, simply run:

umount /localfolder

That’s it, you’re ready to roll ! 👨🏼‍💻

DevOps enthusiast, curious about ever evolving tech. Currently working at