winfsp / sshfs-win

SSHFS For Windows
https://winfsp.dev
Other
5.1k stars 257 forks source link

Clash with Windows 10 SSH client #110

Open lgretton opened 5 years ago

lgretton commented 5 years ago

It seems that when using Windows 10 1803, SSHFS attempts to use the Windows SSH client instead of its own, and therefore fails.

C:\Program Files\SSHFS-Win\bin>.\sshfs.exe -o loglevel=debug3 -d liam@host.example M:
debug3: Failed to open file:C:\\Users\\liam/.ssh/config error:2
debug3: Failed to open file:C:\\ProgramData\\ssh/ssh_config error:2
debug2: resolving "m" port 22
C:\\WINDOWS\\System32\\OpenSSH\\ssh.exe: Could not resolve hostname m: No such host is known.
read: Connection reset by peer

How can I force sshfs to use its own ssh.exe instead of the system one?

mhogomchungu commented 5 years ago

This is a dup of https://github.com/billziss-gh/sshfs-win/issues/39

The solution is to change the PATH environmental variable and put sshfs-win bin folder as its first entry or before %SYSTEMROOT%\System32\OpenSSH\ entry because thats where window's ssh.exe is located.

lgretton commented 5 years ago

Surely SSHFS-Win should explicitly use its own ssh.exe rather than rely on PATH catching it? Changing PATH like this affects everything, so it's likely to break something else if I or another program expects to find the Windows SSH client instead.

Having said that, the two SSH execs ought to be compatible as they're both OpenSSH, so I don't see why sshfs fails if the Windows one is present instead.

Anyway when I get a chance I shall try changing PATH. I can confirm that sorts out sshfs from the command line but I usually map a drive from Explorer and I can't reboot to test that for a while.

billziss-gh commented 5 years ago

@lgretton are you using the beta or the stable version?

To avoid setting the PATH you should use the sshfs-win.exe launcher to launch the file system. This has been improved in the latest beta so that SSHFS-Win can be used via the command line or the WinFsp launcher. (The launcher is the default when not using the command line interface.)

lgretton commented 5 years ago

Finally had a chance to reboot, but setting PATH hasn't helped in my case. I'm on a corporate PC, so my settings for that probably get reset on boot. I've got zero chance of getting the beta version installed either, unfortunately.

I can hack around this with a batch script for the time being though.