[IPython-User] Need more direction Manual SSH tunnels and qtconsole setup

MinRK benjaminrk@gmail....
Fri Aug 10 14:16:57 CDT 2012

On Fri, Aug 10, 2012 at 11:50 AM, reckoner <reckoner@gmail.com> wrote:

> I have been reading the documentation here:
> http://ipython.org/ipython-doc/stable/interactive/qtconsole.html?highlight=remote
> But it doesn't describe *which* ports to forward on  the client when
> doing the manual Port forwarding method. I have already transferred the
> corresponding
> kernel-7524.json file to the client. I don't know if anything in the
> text of that file needs to be changed in order to support the manual
> port forwarding method.
> Some clarification?

The ports are specified in that JSON file, and are randomized.  Depending
on your setup, IPython can try to do the port forwarding for you, in which
case you would do:

# start the kernel on alice
[alice] $ ipython kernel
[IPKernelApp] To connect another client to this kernel, use:
[IPKernelApp] --existing kernel-10934.json

# locate the connection file (or just type it out)
[alice] $ echo `ipython locate profile`/security/kernel-10934.json

# get the connection file to the client machine
[bob] $ scp
alice:/home/you/.ipython/profile_default/security/kernel-10934.json ./

# start the qtconsole, using the connection file, with ssh tunnels to alice:
[bob] $ ipython qtconsole --existing ./kernel-10934.json --ssh alice

If the default tunnels are not going to work for you (requires passwordless
ssh, serendipity, etc.), then you need to inspect the JSON connection file,
open tunnels yourself, and write a *new* connection file pointing to the
local ports you just forwarded and use that as if it were a local kernel:

[bob] $ cat kernel-14080.json
  "stdin_port": 54086,
  "ip": "",
  "hb_port": 59876,
  "key": "2912fd79-2b4d-446b-9f15-738b72f74f6f",
  "shell_port": 64201,
  "iopub_port": 58877

# open tunnels manually
[bob] $ ssh alice -f -N -L 5555: -L 5556: -L
5557: -L 5558:

# write a json file with the new ports:
[bob] $ cat kernel-ssh.json
  "stdin_port": 5555,
  "ip": "",
  "hb_port": 5556,
  "key": "2912fd79-2b4d-446b-9f15-738b72f74f6f",
  "shell_port": 5557,
  "iopub_port": 5558

[bob] $ ipython qtconsole --existing kernel-ssh.json

I hope that clears some things up.


> Thanks!
> _______________________________________________
> IPython-User mailing list
> IPython-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20120810/4ff9847c/attachment-0001.html 

More information about the IPython-User mailing list