I have config file which looks like that

   user <USERNAME>
   hostname <IP>

   user <USERNAME>
   ProxyCommand ssh -q -W %h:%p <NAMEOFHOST>

and after adding this lines to config file I will be able to connect to server with command


However, there is a little problem. I don't have Ubuntu and I'd really like not to install it (because UEFI).

Thus, I'm trying to connect to server with PuTTy.

That's what I've done

Connection -> Proxy -> Proxy type = Local
                       Proxy hostname = <NAMEOFHOST>
                       Telnet command = ssh -q -W %h:%p <USERNAME>@<NAMEOFHOST>
Session -> Hostname <NAMEOFHOST2>
           Connection type = SSH

When I'm trying to connect to server I get "Server unexpectedly closed network connection".

What's wrong with my settings? Thank you.


Thank you for your advise with PuTTY. I tried it, however it didn't want to connect.

Thus, I tried to use OpenSSH. There I just added parameters to ssh_config. However, now, when I try to connect to server I get this

ssh_exchange_identification: Connection closed by remote host.

And I don't have any idea what I am doing wrong.


You probably don't have the ssh binary on your Windows system.

You can use the plink.exe with the -nc switch instead of the ssh with the -W switch:

PuTTY local proxy

An alternative is to open a tunnel via the "NAMEOFHOST" first using an another instance of PuTTY (or Plink).

See for example, my guide for tunneling SFTP/SCP session. It's for WinSCP, but just use PuTTY instead of WinSCP in section Connecting through the tunnel.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.