ssh double tunneling

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hello, here is what i have:

laptop -> server-1 -> server-2

from my terminal i would like to say for example run:

Quoted text here. Click to load it

the problem is that only server1 is allowed to talk to server-2

is there a way to 'double' tunnel from laptop and execute my python
code and for server-2 to respond?


Re: ssh double tunneling

Quoted text here. Click to load it

You don't need double tunneling. Just a normal ssh tunnel is sufficient.

I suppose both servers are in the domain

set up ssh tunneling from your laptop to server1 like:

ssh -L

so port 8000 on your laptop is now forwarded from server1 to server2
port 80.

headers = {'Host': ''}
url = 'http://localhost:8000'
req = urllib2.Request(url, None, headers)
r = urllib2.urlopen(req)
data =

You could even setup the ssh tunnel from your python program with
URL: [PGP 8DAE142BE17999C4]
Private email:

Site Timeline