Thanks to WSL2, it's now finally possible to use SSHFS on Windows! This closes #91
sshopen
Mounts a remote file system over SSH on WSL. Lets you view and edit files on an ssh-accessible server as if they were on your Windows computer.
Unlike sshfs, sshopen automatically handles the creation and subsequent cleanup of the mount directory.
The user_allow_other config option must be uncommented in /etc/fuse.conf
usage
arg 1: the "Host" alias of the server, as specified in your ssh config
arg 2 (optional): the path to the mount directory; defaults to arg1 in the current directory
an example
Let's mount our server, knuth.
sshopen knuth
After mounting the directory, you can also open it in Windows' File Explorer (using open() in .bash_nav).
open knuth
common issues
If the remote server lives behind an AnyConnect VPN, the sshopen command will fail. You should use openconnect to connect to the VPN before using sshopen
Depending on your network connection, sshopen might choke on large files. Consider using scp for such files, instead.
In order to reduce network usage, sshopen will only retrieve new files from the server every 15 minutes. If you want this to happen more frequently, just change the cache_timeout setting in the sshfs command.
The unmount will fail if any processes are still utilizing files in the mount, so you should close Windows File Explorer and any other applications before you close your terminal window. If the unmount fails, you can always just run the unmount commands manually:
Thanks to WSL2, it's now finally possible to use SSHFS on Windows! This closes #91
sshopen
Mounts a remote file system over SSH on WSL. Lets you view and edit files on an ssh-accessible server as if they were on your Windows computer. Unlike
sshfs
,sshopen
automatically handles the creation and subsequent cleanup of the mount directory.prerequisites
~/.ssh/config
sshfs
must be installeduser_allow_other
config option must be uncommented in/etc/fuse.conf
usage
an example
Let's mount our server, knuth.
After mounting the directory, you can also open it in Windows' File Explorer (using
open()
in.bash_nav
).common issues
sshopen
command will fail. You should useopenconnect
to connect to the VPN before usingsshopen
sshfs
giveserror: fuse: device not found, try 'modprobe fuse' first
, then you should use WSL2 and not WSL1sshopen
might choke on large files. Consider usingscp
for such files, instead.sshopen
will only retrieve new files from the server every 15 minutes. If you want this to happen more frequently, just change thecache_timeout
setting in thesshfs
command.