[IPython-User] Tunnelling ipython notebook through gateway server
Thu Feb 21 12:15:46 CST 2013
On Thu, Feb 21, 2013 at 3:16 AM, Jose Gomez-Dans <firstname.lastname@example.org>wrote:
> I have access to a cluster where I can run ipython. I would like to tunnel
> the notebook port so I can access it from my computer, but I have only seem
> how to do that for machines that are single hop.
> My setup is as follows:
> laptop -----SSH-----> gateway -----SSH-----> ipython_host
> So I would need to map port 7000 (eg) on ipython_host through to the
> gateway and back to laptop. It's fairly straightforward to tunneling
> between laptop and gateway, but I can't run ipython there.
> Does anyone have any suggesting, or I should just desist?
Is the ipython_host visible to the gateway directly, or do you really need
two *ssh* hops?
If ipython_host is directly visible from gateway, then it's pretty easy (I
do this regularly):
[laptop] $> ssh gateway -f -N -L 7000:ipython_host:7000
But if you want to tunnel to a tunnel, then it's a bit more convoluted. I
just tried this, and it worked for me:
[laptop] $> ssh gateway -f -L 7000:127.0.0.1:7001 "ssh ipython_host -N -L
Theoretically, you could continue this indefinitely, chaining tunnels by
specifying the command for each tunnel to open the next one.
> IPython-User mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the IPython-User