Windows 10 SSH – Fixing posix_spawn: No Such File or Directory Error

PROXYsshwindows 10

I use Windows10 and I need to use a jumphost to get to my Linux servers. Thus I have configured my .ssh\config like so:

Host jumphost
HostName jumphost.server.local

Host server*.server.local
ProxyCommand  ssh jumphost netcat -w 120 %h %p

But when I run ssh server01.server.local -v (dash-v for verbose) I get the following error:

OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5
debug1: Reading configuration data C:\\Users\\admin/.ssh/config
debug1: C:\\Users\\admin/ssh/config line 70: Applying options for server*.server.local
debug1: Executing proxy command: exec ssh jumphost netcat -w 120 server01.server.local 22
CreateProcessW failed error:2
posix_spawn: No such file or directory

Best Answer

As per this bug, the fix is to use a full path. So this is the correct line in the .ssh/config:

  ProxyCommand  C:\Windows\System32\OpenSSH\ssh.exe jumphost netcat -w 120 %h %p

For further development see this issue: https://github.com/microsoft/vscode-remote-release/issues/18