You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is failing
If I use ProxyJump within SSH URI Usage within my config, I'll get:
Bad stdio forwarding specification ''[192.168.0.1]:22''
Seems like it is doubled escaped.
Host jump_host
HostName 10.0.0.1
User root
Host destination_host
ProxyJump jump_host
HostName 192.168.0.1
User root
Reacted by Andreas Gnau, Thomas Brouard, Bryan Hitchcock and Pak Nin Lui
Just decided to try the native ssh in Windows 10 - and found this bug immediately. I can't access anything since the ProxyJump is required to specify the bastion to jump through. How can I help troubleshoot this?
Windows 10 Enterprise 1803 Build 17134.320
OpenSSH_for_Windows_7.6p1, LibreSSL 2.6.4
PS C:\Users\tatsu> ssh -vvv lab-dpc-tun
OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5
debug1: Reading configuration data C:\\Users\\tatsu/.ssh/config
debug1: C:\\Users\\tatsu/.ssh/config line 65: Applying options for lab-*-tun
debug1: C:\\Users\\tatsu/.ssh/config line 68: Applying options for lab-dpc-tun
debug1: C:\\Users\\tatsu/.ssh/config line 70: Applying options for lab-*
debug3: Failed to open file:C:/ProgramData/ssh/ssh_config error:2
debug2: resolve_canonicalize: hostname 192.168.10.2 is address
debug1: Setting implicit ProxyCommand from ProxyJump: ssh -vvv -W '[%h]:%p' lab-dns
debug1: Executing proxy command: exec ssh -vvv -W '[192.168.10.2]:22' lab-dns
debug3: spawning "C:\\WINDOWS\\System32\\OpenSSH\\ssh -vvv -W '[192.168.10.2]:22' lab-dns"
CreateProcessW failed error:2
posix_spawn: No such file or directory
Latest OpenSSH:
PS C:\Users\tatsu> scoop install win32-openssh
Installing 'win32-openssh' (7.9.0.0p1-Beta) [64bit]
Loading OpenSSH-Win64.zip from cache
Checking hash of OpenSSH-Win64.zip ... ok.
Extracting OpenSSH-Win64.zip ... done.
Linking ~\scoop\apps\win32-openssh\current => ~\scoop\apps\win32-openssh\7.9.0.0p1-Beta
Creating shim for 'scp'.
Creating shim for 'sftp'.
Creating shim for 'sftp-server'.
Creating shim for 'ssh-add'.
Creating shim for 'ssh-agent'.
Creating shim for 'ssh-keygen'.
Creating shim for 'ssh-keyscan'.
Creating shim for 'ssh-shellhost'.
Creating shim for 'ssh'.
Creating shim for 'sshd'.
'win32-openssh' (7.9.0.0p1-Beta) was installed successfully!
Notes
-----
This is a pre-release (non-production ready)
Run 'sudo C:\Users\tatsu\scoop\apps\win32-openssh\current\install-sshd.ps1' to install sshd and ssh-agent as a service.
Run 'sudo C:\Users\tatsu\scoop\apps\win32-openssh\current\uninstall-sshd.ps1' them service.
PS C:\Users\tatsu> C:\Users\tatsu\scoop\apps\win32-openssh\7.9.0.0p1-Beta\ssh.exe -vvv lab-dpc-tun
OpenSSH_for_Windows_7.9p1, LibreSSL 2.6.5
debug1: Reading configuration data C:\\Users\\tatsu/.ssh/config
debug1: C:\\Users\\tatsu/.ssh/config line 65: Applying options for lab-*-tun
debug1: C:\\Users\\tatsu/.ssh/config line 68: Applying options for lab-dpc-tun
debug1: C:\\Users\\tatsu/.ssh/config line 70: Applying options for lab-*
debug3: Failed to open file:C:/ProgramData/ssh/ssh_config error:2
debug2: resolve_canonicalize: hostname 192.168.10.2 is address
debug1: Setting implicit ProxyCommand from ProxyJump: C:\\Users\\tatsu\\scoop\\apps\\win32-openssh\\7.9.0.0p1-Beta\\ssh.exe -vvv -W '[%h]:%p' lab-dns
debug1: Executing proxy command: exec C:\\Users\\tatsu\\scoop\\apps\\win32-openssh\\7.9.0.0p1-Beta\\ssh.exe -vvv -W '[192.168.10.2]:22' lab-dns
debug3: spawning "C:\\Users\\tatsu\\scoop\\apps\\win32-openssh\\7.9.0.0p1-Beta\\ssh.exe -vvv -W '[192.168.10.2]:22' lab-dns"
debug3: spawning C:\\Users\\tatsu\\scoop\\apps\\win32-openssh\\7.9.0.0p1-Beta\\ssh.exe -vvv -W '[192.168.10.2]:22' lab-dns
debug3: w32_getpeername ERROR: not sock :2
debug1: identity file C:\\Users\\tatsu/.ssh/id_ed25519_lab type 3
debug3: Failed to open file:C:/Users/tatsu/.ssh/id_ed25519_lab-cert error:2
debug3: Failed to open file:C:/Users/tatsu/.ssh/id_ed25519_lab-cert.pub error:2
debug1: identity file C:\\Users\\tatsu/.ssh/id_ed25519_lab-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_for_Windows_7.9
Bad stdio forwarding specification ''[192.168.10.2]:22''
ssh_exchange_identification: Connection closed by remote host
Without using jump host (successfully connected):
PS C:\Users\tatsu> .\scoop\apps\win32-openssh\7.9.0.0p1-Beta\ssh.exe -vvv lab-dpc -N
OpenSSH_for_Windows_7.9p1, LibreSSL 2.6.5
debug1: Reading configuration data C:\\Users\\tatsu/.ssh/config
debug1: C:\\Users\\tatsu/.ssh/config line 51: Applying options for lab-dpc
debug1: C:\\Users\\tatsu/.ssh/config line 70: Applying options for lab-*
debug3: Failed to open file:C:/ProgramData/ssh/ssh_config error:2
debug2: resolve_canonicalize: hostname 192.168.10.2 is address
debug2: ssh_connect_direct
debug1: Connecting to 192.168.10.2 [192.168.10.2] port 22.
debug1: Connection established.
debug1: identity file C:\\Users\\tatsu/.ssh/id_ed25519_lab type 3
debug3: Failed to open file:C:/Users/tatsu/.ssh/id_ed25519_lab-cert error:2
debug3: Failed to open file:C:/Users/tatsu/.ssh/id_ed25519_lab-cert.pub error:2
debug1: identity file C:\\Users\\tatsu/.ssh/id_ed25519_lab-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_for_Windows_7.9
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.6p1 Ubuntu-4ubuntu0.1
debug1: match: OpenSSH_7.6p1 Ubuntu-4ubuntu0.1 pat OpenSSH_7.0*,OpenSSH_7.1*,OpenSSH_7.2*,OpenSSH_7.3*,OpenSSH_7.4*,OpenSSH_7.5*,OpenSSH_7.6*,OpenSSH_7.7* compat 0x04000002
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to 192.168.10.2:22 as 'tatsu16'
debug3: hostkeys_foreach: reading file "C:\\Users\\tatsu/.ssh/known_hosts"
debug3: record_hostkey: found key type ECDSA in file C:\\Users\\tatsu/.ssh/known_hosts:16
debug3: load_hostkeys: loaded 1 keys from 192.168.10.2
debug3: Failed to open file:C:/Users/tatsu/.ssh/known_hosts2 error:2
debug3: Failed to open file:C:/ProgramData/ssh/ssh_known_hosts error:2
debug3: Failed to open file:C:/ProgramData/ssh/ssh_known_hosts2 error:2
debug3: order_hostkeyalgs: prefer hostkeyalgs: [email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
debug3: send packet: type 20
debug1: SSH2_MSG_KEXINIT sent
debug3: receive packet: type 20
debug1: SSH2_MSG_KEXINIT received
debug2: local client KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,[email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1,ext-info-c
debug2: host key algorithms: [email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],[email protected],[email protected],[email protected],ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
debug2: ciphers ctos: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]
debug2: ciphers stoc: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]
debug2: MACs ctos: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none
debug2: compression stoc: none
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug2: peer server KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,[email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1
debug2: host key algorithms: ssh-rsa,rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519
debug2: ciphers ctos: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]
debug2: ciphers stoc: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]
debug2: MACs ctos: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,[email protected]
debug2: compression stoc: none,[email protected]
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
debug3: send packet: type 30
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug3: receive packet: type 31
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:[Host key]
debug3: hostkeys_foreach: reading file "C:\\Users\\tatsu/.ssh/known_hosts"
debug3: record_hostkey: found key type ECDSA in file C:\\Users\\tatsu/.ssh/known_hosts:16
debug3: load_hostkeys: loaded 1 keys from 192.168.10.2
debug3: Failed to open file:C:/Users/tatsu/.ssh/known_hosts2 error:2
debug3: Failed to open file:C:/ProgramData/ssh/ssh_known_hosts error:2
debug3: Failed to open file:C:/ProgramData/ssh/ssh_known_hosts2 error:2
debug1: Host '192.168.10.2' is known and matches the ECDSA host key.
debug1: Found key in C:\\Users\\tatsu/.ssh/known_hosts:16
debug3: send packet: type 21
debug2: set_newkeys: mode 1
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug3: receive packet: type 21
debug1: SSH2_MSG_NEWKEYS received
debug2: set_newkeys: mode 0
debug1: rekey after 134217728 blocks
debug3: unable to connect to pipe \\\\.\\pipe\\openssh-ssh-agent, error: 2
debug1: pubkey_prepare: ssh_get_authentication_socket: No such file or directory
debug1: Will attempt key: C:\\Users\\tatsu/.ssh/id_ed25519_lab ED25519 SHA256:[My key] explicit
debug2: pubkey_prepare: done
debug3: send packet: type 5
debug3: receive packet: type 7
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521>
debug3: receive packet: type 6
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug3: send packet: type 50
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,password
debug3: start over, passed a different list publickey,password
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering public key: C:\\Users\\tatsu/.ssh/id_ed25519_lab ED25519 SHA256:[My key] explicit
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 60
debug1: Server accepts key: C:\\Users\\tatsu/.ssh/id_ed25519_lab ED25519 SHA256:[My key] explicit
debug3: sign_and_send_pubkey: ED25519 SHA256:[My key]
debug3: sign_and_send_pubkey: signing using ssh-ed25519
debug3: send packet: type 50
debug3: receive packet: type 52
debug1: Authentication succeeded (publickey).
Authenticated to 192.168.10.2 ([192.168.10.2]:22).
debug2: fd 3 setting TCP_NODELAY
debug1: Requesting [email protected]
debug3: send packet: type 80
debug1: Entering interactive session.
debug1: pledge: network
debug3: receive packet: type 80
debug1: client_input_global_request: rtype [email protected] want_reply 0
Pretty embarrassing that a simple issue such as this that was patched over a year ago hasn't made it to release yet. This is why people dislike Windows so much.
Reacted by Luke Carrier, novelistparty, General Zod, Tim Liu, Russell, Ivar Thokle Hovden, Gert van den Berg and Sylwester Fraczek
Niklas Holm (@niklasholm)
Try choco instal openssh. (Install via Chocolatey) Version 8.0 is available.
The pre-installed version in Windows is too late to be updated.
I use this config on my windows 10 machine.it is successful!!!!!!!
Host jump
HostName xxx
User xxx
Port xxx
Host your_machine
HostName xxxx
User xxx
ProxyCommand c:/Windows\System32\OpenSSH/ssh.exe jump -W %h:%p
It works. But it hardcoded the ssh command as well as parameters. If I want to refer ssh_config from other locations like ssh -F C:/my/wsl/distribution/ssh_config, (cases when using VSCode Remote) I'll need to write everything inside ProxyCommand string as well. In the contrary, ProxyJump could build the command line automatically, but as said in this issue, it didn't add ssh.exe executable path correctly.
I use this config on my windows 10 machine.it is successful!!!!!!!
Host jump
HostName xxx
User xxx
Port xxx
Host your_machine
HostName xxxx
User xxx
ProxyCommand c:/Windows\System32\OpenSSH/ssh.exe jump -W %h:%p
Works! For me the ProxyCommand could use only generic ssh executable instead of specifying exact path:
ProxyCommand ssh jump -W %h:%p
Both worked for me; took me a day to solve that issue. Since it wasn't patched since a while, the paper trail on the web is pretty long, which doesn't make debugging easier.
I assume we have to wait for Windows to update via Windows update
David Alsh (@alshdavid) The omission of an up-to-date version of OpenSSH in the latest Windows 10 release was addressed by Microsoft in #1693. You can track this problem there.
I'm hoping that they will add it via a servicing update, but no news yet.
I use this config on my windows 10 machine.it is successful!!!!!!!
Host jump
HostName xxx
User xxx
Port xxx
Host your_machine
HostName xxxx
User xxx
ProxyCommand c:/Windows\System32\OpenSSH/ssh.exe jump -W %h:%p
Works! For me the ProxyCommand could use only generic ssh executable instead of specifying exact path:
ProxyCommand ssh jump -W %h:%p
Both worked for me; took me a day to solve that issue. Since it wasn't patched since a while, the paper trail on the web is pretty long, which doesn't make debugging easier.
感谢回复答案,你解决了我的问题。但答案不严谨, ssh 的绝对路径每个人的不同,可以先运行 where ssh 查看,再替换
Activity
manojampalam commentedon Jun 4, 2018
Can you add some more details on how to do this in a simple setup? Perhaps using the local sshd endpoint as a proxyjump onto itself?
cw789 commentedon Jun 5, 2018
Of course. I've seen it generally concerns ProxyJump. So it doesn't depend on the ssh_config.
You can reproduce it simple by running
ssh -J localhost localhost.Output:
gobbedy commentedon Jun 22, 2018
I get the same error
I use OpenSSH_for_Windows_7.6p1, and Windows 10 Education
ssh -J user1@jumphost user2@server
Bad stdio forwarding specification ''[server]:22''ssh_exchange_identification: Connection closed by remote hostTheLinuxNinja commentedon Oct 10, 2018
Just decided to try the native ssh in Windows 10 - and found this bug immediately. I can't access anything since the ProxyJump is required to specify the bastion to jump through. How can I help troubleshoot this?
Windows 10 Enterprise 1803 Build 17134.320
OpenSSH_for_Windows_7.6p1, LibreSSL 2.6.4
oscarvdl commentedon Dec 21, 2018
Have the same issue on Microsoft Windows [Version 10.0.17134.471]
Bad stdio forwarding specification ''[example.com]:22''
ssh_exchange_identification: Connection closed by remote host
cw789 commentedon Dec 22, 2018
Workaround:
ProxyCommand ssh -W %h:%p jump_hostwill also work on Windows meanwhile.tats-u commentedon Jan 18, 2019
I'm bothered by this issue. (10 Pro 1809)
Latest OpenSSH:
Without using jump host (successfully connected):
jaketyo commentedon Jan 21, 2019
I am also suffering from this issue. Does anyone have an update?
I redacted the hostnames. However, they are correct.
24 remaining items
manojampalam commentedon Jul 11, 2019
This was fixed as part of #1185. Try v7.9 or later
quoniammm commentedon Oct 19, 2019
I use this config on my windows 10 machine.it is successful!!!!!!!
Host jump HostName xxx User xxx Port xxx Host your_machine HostName xxxx User xxx ProxyCommand c:/Windows\System32\OpenSSH/ssh.exe jump -W %h:%pvrastil commentedon Oct 30, 2019
Works! For me the ProxyCommand could use only generic ssh executable instead of specifying exact path:
niklasholm commentedon Mar 16, 2020
Pretty embarrassing that a simple issue such as this that was patched over a year ago hasn't made it to release yet. This is why people dislike Windows so much.
tats-u commentedon Mar 16, 2020
Niklas Holm (@niklasholm)
Try
choco instal openssh. (Install via Chocolatey) Version 8.0 is available.The pre-installed version in Windows is too late to be updated.
ttimasdf commentedon Apr 5, 2020
It works. But it hardcoded the ssh command as well as parameters. If I want to refer ssh_config from other locations like
ssh -F C:/my/wsl/distribution/ssh_config, (cases when using VSCode Remote) I'll need to write everything insideProxyCommandstring as well. In the contrary,ProxyJumpcould build the command line automatically, but as said in this issue, it didn't addssh.exeexecutable path correctly.filviu commentedon Apr 7, 2020
Windows 1909 and this still doesn't work. Full path is not an option as I use this config file inside wsl as well.
pd93 commentedon Apr 7, 2020
@silviuvulcan If you can't wait for this to be released into Windows (I know I couldn't), you could always patch it yourself.
DiamondDemon669 commentedon Jun 23, 2020
same issue
Cuberick-Orion commentedon Dec 23, 2020
I'm on 20H2 and the issue persists. Can confirm that the full-path workaround is effective.
Took me a long time to figure this out...
sgugler commentedon Dec 23, 2020
Both worked for me; took me a day to solve that issue. Since it wasn't patched since a while, the paper trail on the web is pretty long, which doesn't make debugging easier.
alshdavid commentedon Feb 1, 2021
Updating to the latest beta version on the releases page fixed it for me. I am running version
OpenSSH_for_Windows_8.1p1, LibreSSL 2.9.2.I assume we have to wait for Windows to update via Windows update. I recommend managing the version yourself.
You can also use Choco to install via command line
pd93 commentedon Feb 3, 2021
David Alsh (@alshdavid) The omission of an up-to-date version of OpenSSH in the latest Windows 10 release was addressed by Microsoft in #1693. You can track this problem there.
I'm hoping that they will add it via a servicing update, but no news yet.
wangwanjie commentedon Jun 18, 2022
感谢回复答案,你解决了我的问题。但答案不严谨, ssh 的绝对路径每个人的不同,可以先运行 where ssh 查看,再替换
Fix issue with ProxyJump on Windows