How to run IPython notebook remotely?
Following these instructions ( Starting the laptop server and Remote access to IPython Laptops ) I do the following:
On the remote server:
1) Setting up NotebookApp.password ()
In [1]: from IPython.lib import passwd
In [2]: passwd()
Enter password:
Verify password:
Out[2]: 'sha1:67c9e60bb8b6:9ffede0825894254b2e042ea597d771089e11aed'
2) Create a profile
user@remote_host$ ipython profile create
3) Edit ~/.ipython/profile_default/ipython_notebook_config.py
# Password to use for web authentication
c = get_config()
c.NotebookApp.password =
u'sha1:67c9e60bb8b6:9ffede0825894254b2e042ea597d771089e11aed'
4) Run notepad on port 8889
user@remote_host$ ipython notebook --no-browser --port=8889
and the laptop will start
[I 16: 08: 10.012 NotebookApp] Using MathJax from CDN: https://cdn.mathjax.org/mathjax/latest/MathJax.js
[W 16: 08: 10.131 NotebookApp] Terminals not available (error: no module named 'terminado')
[I 16: 08: 10.132 NotebookApp] Serving notebooks from the local directory: / cluster / home / user
[I 16: 08: 10.132 NotebookApp] 0 active cores
[I 16: 08: 10.132 NotebookApp] IPython notebook runs at: http: // localhost: 8889 /
[I 16: 08: 10.132 NotebookApp] Use Control-C to stop this server and shutdown all cores (twice to skip confirmation).
On my local machine
5) SSH tunneling
user@local$ ssh -N -f -L localhost:8888:127.0.0.1:8889 username@remote_host
On remote host ( /etc/hosts
) you will find
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
6) Finally, I try to open localhost:8888
in my browser and I get:
channel 2: failed failed: connection failed: connection refused
channel 2: failed failed: connection failed: connection refused
channel 2: failed failed: connection failed: connection refused
channel 2: failed failed: connection failed: connection refused
channel 2: failed failed: connection failed: connection refused
All of these steps work on one server, but don't work on another.
I tried to contact the administrator and said the following:
I am assuming you are using two separate SSH connections: one that you run ipython and the one that you use for port forwarding. There is no guarantee that these two connections will drop you off at the same node login. In the event that two connections are enabled by different hosts, you will experience the exact failure that you have encountered. Therefore, you need to set up port forwarding on the connection you are using to run ipython.
How can I set up port forwarding on the connection I am using to run ipython?
I tried using my ip but it didn't work
$ ssh -N -f -L local_ip_address:8888:127.0.0.1:8889 user@remote_host
source to share
Just follow this instruction.
https://coderwall.com/p/ohk6cg/remote-access-to-ipython-notebooks-via-ssh
source to share