[IPython-User] Tunnelling ipython notebook through gateway server
Thu Feb 21 10:37:19 CST 2013
I had to do something like this recently and one of the simplest ways that
I've found is to modify your ssh config file as follows:
[user@mylaptop ~/]# cat .ssh/rsg_config
# Host is whatever friendly name you want to use for the ipython_host
# ipython_host ssh username
# Actual ipython hostname
# Path to your private key file if you're using one and only needs
# to be defined if you're not using the default one (~/.ssh/id_rsa)
# This will come into play when connecting to the gateway
# This is the command that will be invoked on the gateway host after
# you connect. As you can see it simply executes an nc (netcat) which just
# echoes all of your traffic to the ipython_host
# %h is the 'HostName' defined above
# %p is the port which defaults to 22
ProxyCommand ssh -q -i ~/.ssh/ipython_id_rsa
email@example.com %h %p 2>/dev/null
You should then in theory be able to access the ipython notebook instance
on your laptop by running:
ssh -L 8888:localhost:8888 ipy_host &
(& will background)
and then you should be able to hit the site in your browser on
Lemme know if this works or if you have any questions. If this does work
perhaps we should post this somewhere.
On Thu, Feb 21, 2013 at 6: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?
> IPython-User mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the IPython-User