levitra uk
link kjøp cialis Viagra ohne rezept dove comprare levitra online viagra billig online bestellen levitra generico viagra generika kaufen deutschland cialis farmacia online italia preisvergleich viagra generika Levitra kaufen online Comprare cialis viagra preis apotheke Acquistare viagra online Levitra generika kaufen cialis rezeptfrei cialis kaufen ohne rezept acheter viagra online viagra apotheke preis levitra acquisto on line italia Kjøp viagra online costo cialis generico viagra günstig kaufen cialis prix pharmacie levitra originale prezzo in farmacia
trimly viagra otc allegretto belfries Naenius :: Development is a state of mind :

6 Responses to “SSH Tunneling across multiple hosts in Linux”

Accidentily, I learned about this while getting worked in a couple days ago. But I learned a few other tricks as well:

add -f, which means that ssh goes into the background after connecting, so you don’t have to leave your terminal window open

In your example, you tunnel twice for a single host, to get back to port 80. Instead, you can use -D and no tunnel, which will create a SOCKS proxy. Execute the command, configure the proxy in your browser, and you can reach any host that is reachable by Server A. If you need to SSH forward to server B, or anything else that can’t use a SOCKS proxy, then you can suffice with a single tunnel (since you don’t need to go back to the specific port).


The is a disadvantage in this approach. You are setting up two tunnels. One from local to A and one from A to B. That means that you would need an (Open)SSH deamon on your server B.

However in your situation you say that server B is accessible from Server A meaning that you actually don’t need the second tunnel right? Wouldn’t it be easier to just tunnel a non-localhost connection through server A? Something like this would probably work.

ssh -t -t -L8081:b.server.example.com:80 mvriel@a.server.example.com

I really like your writing style, fantastic information, thanks for putting up :D .

This helped. Thanks a lot for the clear post on SSH Tunneling

hey,thanks for your post,i have a problem,when i try to tunnel,i after connecting to second server.i try to reach a website,and in terminal i get “channel 3: open failed: connect failed: Connection refused”

i am trying to tunnel through main server of our department(university) to tunnel through a linux pc. it’s obvious that i don’t have root privilages on any of these systems.:D can you help me please?:)


I did try ssh -t -t -L[LOCAL_PORT]:localhost:[PORT_ON_A] [USER]@[SERVER_A] ‘ssh -L[PORT_ON_A]:localhost:[PORT_ON_B] [USER]@[SERVER_B]‘ However, it is asking for a password. What password do I need to input? I tried with the root password of serverA but did not work. I also tried the password of serverB but no luck.

Any help?

Thank you

Leave a Reply