Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 –iMy_SSH_Private.ssh –o’ProxyCommand=ssh 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 -nc -i My_SSH_Private.ppk

What am I doing wrong?

share|improve this question

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

plink.exe -i My_SSH_Private.ppk "ssh"

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.

share|improve this answer
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 '13 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 '13 at 14:31

You must log in to answer this question.

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