OpenSSH ProxyCommand equivalent in PuTTY

2

1

I have config file which looks like that

Host <NAMEOFHOST>
   user <USERNAME>
   hostname <IP>

Host <NAMEOFHOST2>
   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

ssh <NAMEOFHOST2>

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.

UPDATE

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.

AleksandrMonk

Posted 2016-12-24T08:54:10.490

Reputation: 121

1

OpenSSH works in Windows too. Under cygwin or directly provided by MS

– Jakuje – 2016-12-24T09:37:28.000

Answers

6

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.

Martin Prikryl

Posted 2016-12-24T08:54:10.490

Reputation: 13 764