I'm trying to connect to an SSH server from a Windows PC behind a corporate HTTP proxy.

The trick works under Debian using OpenSSH client with ncat from the nmap package, but it does not work under Windows with Plink 0.70 + Ncat 7.70 (https://nmap.org). Putty works fine too, though using pure plink would be better for me.

Plink has the -proxycmd option, which seems to be similar to the ProxyCommand option in OpenSSH. However, it does not work as expected (SSH server is running on port 443):

plink.exe -C -ssh -P 443 -i my_pvt_key.ppk -proxycmd "ncat --verbose --proxy-type http --proxy %host %port" -sshlog sshlog.txt [email protected]

The command immediately returns "FATAL ERROR: Server unexpectedly closed network connection".

Putty log:

=~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2018.07.19 07:38:28 =~=~=~=~=~=~=~=~=~=~=~=
Event Log: Writing new session log (SSH packets mode) to file: sshlog.txt
Event Log: Starting local proxy command: ncat --verbose --proxy-type http --proxy port
Event Log: We claim version: SSH-2.0-PuTTY_Release_0.70
Event Log: Server unexpectedly closed network connection

The third line of the log is confusing. There is the word 'port' in the end of the command, and it should have been replaced with the actual port. Host is not shown at all.

The command ncat --verbose --proxy-type http --proxy 443 itself seems to work fine. Thus, I suppose, the problem is that Plink doesn't parse arguments in the ncat command correctly. I am probably wrong.

Any ideas how to fix that?

2 Answers 2


In Putty, in Configuration->Connection->Proxy, you can configure a HTTP Proxy directly without using ncat.

In plink, you can refer to a Putty configuration. The help text says

"host" can also be a PuTTY saved session name

So just call plink with the configuration you saved.


Thanks you question, i success in Window 10 1903 via open ssh, below is my command:

 ssh [email protected] -o "ProxyCommand C:\Program Files (x86)\Nmap\ncat.exe --verbose --proxy-type http --proxy %h %p" -v

With plink: Release 0.71(64-bit), OP command work fine, but cmd will show some not recognized chart without color. Better to use open ssh in windows 10?

plink.exe -C -ssh -P 27158 -i C:\Users\xxx\.ssh\test.ppk -proxycmd "ncat --verbose --proxy-type http --proxy %host %port" [email protected] sshlog.txt
  • 1
    The question is not about using SSH as the client.
    – RalfFriedl
    Jun 22, 2019 at 19:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .