Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ssh tunneling

Status
Not open for further replies.

sbrews

Technical User
Jun 11, 2003
413
US
I've googled and search the archives here, but havent found what it is I am trying to do...

I would like to tunnel ssh from my laptop via a 2nd system to a final 3rd system.

My laptop is IP A
2nd system is IP B
3rd system is IP C

A cannot get to C directly, but B can. What do I need to so that I can ssh from A, hop via B and end up on C?

Add a little color to your PUTTY terminal: faq52-6627
 
I am not aware of any application to blindly tunnel an SSH connection, which is what it sounds like you are after. At my home, I have a public facing server that I can SSH into and from there I can SSH into other machines that are not public facing. I have also used this trick to do x-forwarding or use FreeNX.

To answer your question, SSH from A into B and then SSH again into C.

 
Hi,

The way to go is the one that Noway2 has explain you.

Connect to systemB from your laptop via ssh, and then,from systemB connect to systemC via ssh as well.

That's the way I use to do when connecting from my laptop via VPN to the office to do remote jobs at weekend.
 
I think you may also consider reserching local & remote port forwarding.

If i understand it correctly you may be able to achieve a direct connection with remote prot forwarding (but I dont have the setup necessary to test.)

I do not Have A.D.D. im just easily, Hey look a Squirrel!
 
just tested something
looks like local port forwarding is what you require

1st
ssh -L 8888:systemc:22 user@systemb

then ssh -p 8888 localhost



I do not Have A.D.D. im just easily, Hey look a Squirrel!
 
I've tried that... I must be doing something wrong as the 1st ssh command ultimately logs me in to systemb.

Ultimately not a big deal - was just trying to save myself a login sequence.

Add a little color to your PUTTY terminal: faq52-6627
 
Yes the 1st ssh will logg you into B
if you now start a 2nd shell you should be able to log direct to system C

of course it may just be easier to ssh to c from b

I use the forwarding options to enable me to remotly access services that are usualy only available behind my firewall
(such as my phpmysqladmin page).


I do not Have A.D.D. im just easily, Hey look a Squirrel!
 
Maybe you could set up stunnel on system B to forward the session to system C.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top