Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 user@internal.corp.com –iMy_SSH_Private.ssh –o’ProxyCommand=ssh user@gateway.corp.com 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 user@internal.corp.com -nc user@gateway.corp.com:2223 -i My_SSH_Private.ppk

What am I doing wrong?

share|improve this question

1 Answer 1

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

plink.exe -i My_SSH_Private.ppk user@gateway.corp.com:2223 "ssh user@internal.corp.com"

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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