LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   SSH chain tunneling (https://www.linuxquestions.org/questions/linux-general-1/ssh-chain-tunneling-767875/)

netpumber 11-09-2009 05:33 AM

SSH chain tunneling
 
Halo!!

Lets say i have ssh access into 3 servers (A, B, C).

I am the PC. Now how i can do a connection like this :

PC --> A --> B --> C through ssh connection?

So i can browse to the internet with the server's C ip.

Thanks..!

mrclisdue 11-09-2009 06:10 AM

I'm thinking someone may have a more elegant solution, but you can do it thusly:

B --> C :

ssh -D <choose_port> C

A --> B

ssh -N -f -L <port>:localhost:<port> B

PC --> A

ssh -N -f -L <port>:localhost:<port> A

Set up a SOCKS proxy on PC to localhost:<port>

cheers,

tacorama 11-09-2009 07:43 AM

netplumber,

Thanks to your question - i felt motivated to read the entire ssh man page. it seems ssh is quite powerful and i am now looking forward to trying some things out.


mrclisdue,

Thanks also for your simple explanation.

Karas 11-14-2009 12:58 PM

Hi there I have just found this thread after posting a similar one, (oops!) and was wondering if someone could explain how I would do this via putty, and with a PC and machine A and B? Machine B, being the server thats hosting the pages I want to view.


All times are GMT -5. The time now is 09:01 PM.