Monday, May 18, 2009

Setting up ssh to create a transparent tunnel through a bastion server

You need to ssh into server on given network (or environment) at work.

The 'manual' way:

ssh bastion.server (once you logged in, you login to the actual server you trying to get to)
ssh final.destination.server

An easier way:


ssh -t bastion-server ssh -t final.destination.server

With ssh ProxyCommand:

Edit your .ssh/config:

Host bastion
Hostname bastion.server
User your_username

Host final-host
ProxyCommand ssh -q -a -x bastion nc final.destination.server 22

Note: The bastion server needs the nc command installed for this to work.

Now, you can:

ssh final-host

or

scp somefile final-host:/tmp

0 comments: