1

I'm trying to setup an SSH connection to an internal server that is only available when proxy'd through a public SSH server like below Me > Gateway SSH Server > Internal SSH Server

On linux I can successfully use a command such as: ssh [email protected] –iMy_SSH_Private.ssh –o’ProxyCommand=ssh [email protected] nc %h %p’

Note that both servers require the SSH key to be provided

I want to replicate this on Putty and thought it should be possible by setting Putty's proxy to use plink but this seems to hang. My example plink proxy command is: plink.exe [email protected] -nc [email protected]:2223 -i My_SSH_Private.ppk

What am I doing wrong?

2 Answers 2

1

The best way I've found to do this is similar to what you've got, but you need pageant running. Add your key(s) to that and then set the local proxy command to:

plink -agent -l %user %proxyhost -nc %host:%port

That will tell plink to use the pageant keys to authenticate to both hosts. I've found that if I forget to load my key up first, it will just hang connecting to the proxy box.

PS, I realize this is very old, but just in case someone comes across it like I did when researching another plink issue.

0

I think the nc (no command?) option creates a tunnel, without starting a login shell. Try

plink.exe -i My_SSH_Private.ppk [email protected]:2223 "ssh [email protected]"

In cases similar to yours, I just ssh to the first server, then ssh from there to the target server. Not very elegant, I guess. But then I use Pageant and enable agent forwarding in Putty (Settings->Connection->SSH->Auth->Allow agent forwarding), so my shell on the gateway server has access to my (local) private key through the forwarded agent process. That makes for pretty smooth ssh-server-hopping.

2
  • Thanks, I just tried the above (with relevant substitutions) and it just hangs, no error, just hangs until I close the putty window then the plink process eats up every CPU cycle available to it which is even more odd. I guess using pagent is the next step although I was rather hoping not to do so to make it as portable to colleagues as possible.
    – moztech
    Jun 19, 2013 at 14:00
  • Yeah, I see. Plink doesnt seem to be any good for an interactive login shell - it prints control characters in the CMD window. And the same thing happens if I run plink to get a login shell at the GW-server, and then run "ssh internal-server" - it just hangs until CTRL-C'ed. I guess Putty is necessary then. For portability, I beleive you can create connection profiles as reg-files, so the default settings can be easily distributable.
    – Kenned
    Jun 19, 2013 at 14:31

You must log in to answer this question.

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