Server Fault is a question and answer site for system and network administrators. 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

We have some unix boxes setup in a way that to get to the development box via ssh, you have to ssh into a 'user@jumpoff' box first. There is no direct connection allowed on 'dev' via ssh from anywhere but 'jumpoff'. Furthermore, only key exchange is allowed on both servers. And you always login to the development box as 'build@dev'.

It's painful to always do that hopping. I know this can be done with SOCKS or a Tunnel or something...

I have setup a FreeBSD VM and I can get things to work awesome using unix ssh tools. Basically all I do is make sure my vm's ~/.ssh/ key is on both jumpoff and dev and use this ~/.ssh/config file:

# Development Server
Host            ext-dev  # this must be a resolvable name for "dev" from Jumpoff
User            build
IdentityFile    ~/.ssh/id_rsa  

# The Jumpoff Server
Host            ext 
User            daevid
Port            22 
IdentityFile    ~/.ssh/id_rsa

# This must come below all of the above 
Host            ext-* 
ProxyCommand    ssh ext nc $(echo '%h'|cut -d- -f2-) 22 

Then I just simply type "ssh ext-dev" and I'm in like Flynn.

The problem is I can't get this same thing to work using either PuTTY or SecureCRT -- and to be honest I've not found any tutorials that really walk me through it. I see many on setting up some kind of proxy tunnel for Firefox, but it doesn't seem to be the same concept. I've been messing with various trial and error most all day and nothing has worked (obviously) and I'm at the end of my ssh knowledge and Google searching.

I found this link which seemed to be perfect, but it doesn't work for me. The "Master" connects fine, but the "client" portion doesn't connect. It tells me, the remote system refused the connection.

I've got the VM, PuTTY and SecureCRT all using the same public/private key pairs to make things consistent and easier to debug.

Does anyone have a straight up example of how to do this in Windows?

share|improve this question

With PuTTY, make sure you have "agent forwarding" enabled, and your private key loaded in Pageant.

share|improve this answer

It does seem that PuTTY version 0.59 and later supports ProxyCommand-like syntax; see, for example, this blog post. You most likely don't want to use SOCKS. You want to be careful about having strong passphrases for your keys; it's not clear from your OpenSSH example whether you have any passphrase on your key or whether you're using ssh-agent or the like.

share|improve this answer
That link is perfect! That seems to do exactly what I wanted without the BS of having extra shells open and a two step process... now if only someone would make a SecureCRT version that does the same thing... hint hint... :) – DAE51D Mar 30 '11 at 22:02

For those who are interested in doing this with SecureCRT, here it is:

  1. Create a SSH session as usual.

  2. In properties, select Port Forwarding and click Add..., make sure to check "Dynamic forwarding using SOCKS 4 or 5" option, fill the local address and port accordingly.

  3. Done. From now on, each time you ssh with this session config, a tunnel is created automatically, when you disconnect, the tunnel's gone. Pretty much the same as in a Linux box.


share|improve this answer

Your Answer


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.