SSHFS on Windows
Sometimes it's more convenient to do file operations from a remote system on your home machine. One of the simplest way to do this is by using the SSH File System(SSHFS). After typing the remote system URL and credentials, you effectively mount the path to your machine as a virtual drive.
When going from Linux-to-Linux things just work out of the box. But when going from Windows-to-Linux, we have some steps to do first.
There are several ways on achieving this, some are more elaborate, others require using GUI apps. The one I use is the simplest I found and it makes the mount persist between boots for convenience(although it will ask for your credentials if you try to access it after a sleep or reboot, if you have not used ssh-copy-id on the remote machine yet.)
We need to install two packages using WinGet(I found that WinGet is a great way to install programs and packages system-wide on Windows. It mimics the traditional package managers on Linux distributions. You can browse which applications you can install from it by searching the repository: https://winstall.app/).
Open your Windows Terminal and type:
winget install --silent --exact --id "WinFsp.WinFsp"
Hit enter to install the first package. Then type:
winget install --silent --exact --id "SSHFS-Win.SSHFS-Win"
To install SSHFS proper.
Now you can access your remote system by using the "net use" command, then typing the disk to map it, the username and the address of the system, for example:
net use I: \\sshfs\ubuntu@192.168.15.60
Here, "I:" is the virtual disk I want to create to map the file system to. Then, after "\\sshfs\", type your username on the remote system(in this case "ubuntu"), finally, an "@" symbol followed by the DNS-resolved server name or the raw address of the machine in your network. Type the credentials and the disk you be listed on Windows' File Explorer for your use.
When you're done, you can unmount it with:
net use /del I:
That's all there is to it. As mentioned before, the mount will persist between boots, so if you need to access a remote file system regularly, add it as a virtual drive and forget about it.
See you next mission.