如何远程启动 IPython notebook?
How to start IPython notebook remotely?
遵循这些说明(Running a notebook server and Remote access to IPython Notebooks
) 我进行如下操作:
在远程服务器上:
1) 设置 NotebookApp.password()
In [1]: from IPython.lib import passwd
In [2]: passwd()
Enter password:
Verify password:
Out[2]: 'sha1:67c9e60bb8b6:9ffede0825894254b2e042ea597d771089e11aed'
2) 创建配置文件
user@remote_host$ ipython profile create
3) 编辑 ~/.ipython/profile_default/ipython_notebook_config.py
# Password to use for web authentication
c = get_config()
c.NotebookApp.password =
u'sha1:67c9e60bb8b6:9ffede0825894254b2e042ea597d771089e11aed'
4) 在端口 8889 上启动笔记本
user@remote_host$ ipython notebook --no-browser --port=8889
笔记本启动
[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 was No module named 'terminado')
[I 16:08:10.132 NotebookApp] Serving notebooks from local directory: /cluster/home/user
[I 16:08:10.132 NotebookApp] 0 active kernels
[I 16:08:10.132 NotebookApp] The IPython Notebook is running at: http://localhost:8889/
[I 16:08:10.132 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
在我的本地机器上
5) SSH 隧道
user@local$ ssh -N -f -L localhost:8888:127.0.0.1:8889 username@remote_host
在远程主机 (/etc/hosts
) 上您找到
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
6) 最后,我尝试在我的浏览器上打开 localhost:8888
,我得到:
channel 2: open failed: connect failed: Connection refused
channel 2: open failed: connect failed: Connection refused
channel 2: open failed: connect failed: Connection refused
channel 2: open failed: connect failed: Connection refused
channel 2: open failed: connect failed: Connection refused
所有这些步骤在一台服务器上有效,但在另一台服务器上失败。
我尝试联系管理员并说了以下内容:
I assume that you are using two separate SSH connections: one from
which you run ipython and one that you use to do port forwarding.
There is no guarantee that the two connections will land you on the
same login node. In the case where the two connections are on
different hosts, you will experience the exact failure you have
encountered. Therefore you should setup the port forwarding in the
connection that you use to run ipython.
如何在用于 运行 ipython 的连接中设置端口转发?
我试过使用我的 IP 地址,但没有成功
$ ssh -N -f -L local_ip_address:8888:127.0.0.1:8889 user@remote_host
最后问题是这样解决的:
# Login to the server from your local workstation and in the same connection do the port forwarding.
user@local$ ssh -L 8888:localhost:8889 username@remote_host
user@remote_host$ ipython notebook --no-browser --port=8889
只需按照此说明操作即可。
https://coderwall.com/p/ohk6cg/remote-access-to-ipython-notebooks-via-ssh
遵循这些说明(Running a notebook server and Remote access to IPython Notebooks ) 我进行如下操作:
在远程服务器上:
1) 设置 NotebookApp.password()
In [1]: from IPython.lib import passwd
In [2]: passwd()
Enter password:
Verify password:
Out[2]: 'sha1:67c9e60bb8b6:9ffede0825894254b2e042ea597d771089e11aed'
2) 创建配置文件
user@remote_host$ ipython profile create
3) 编辑 ~/.ipython/profile_default/ipython_notebook_config.py
# Password to use for web authentication
c = get_config()
c.NotebookApp.password =
u'sha1:67c9e60bb8b6:9ffede0825894254b2e042ea597d771089e11aed'
4) 在端口 8889 上启动笔记本
user@remote_host$ ipython notebook --no-browser --port=8889
笔记本启动
[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 was No module named 'terminado')
[I 16:08:10.132 NotebookApp] Serving notebooks from local directory: /cluster/home/user
[I 16:08:10.132 NotebookApp] 0 active kernels
[I 16:08:10.132 NotebookApp] The IPython Notebook is running at: http://localhost:8889/
[I 16:08:10.132 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
在我的本地机器上
5) SSH 隧道
user@local$ ssh -N -f -L localhost:8888:127.0.0.1:8889 username@remote_host
在远程主机 (/etc/hosts
) 上您找到
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
6) 最后,我尝试在我的浏览器上打开 localhost:8888
,我得到:
channel 2: open failed: connect failed: Connection refused
channel 2: open failed: connect failed: Connection refused
channel 2: open failed: connect failed: Connection refused
channel 2: open failed: connect failed: Connection refused
channel 2: open failed: connect failed: Connection refused
所有这些步骤在一台服务器上有效,但在另一台服务器上失败。
我尝试联系管理员并说了以下内容:
I assume that you are using two separate SSH connections: one from which you run ipython and one that you use to do port forwarding. There is no guarantee that the two connections will land you on the same login node. In the case where the two connections are on different hosts, you will experience the exact failure you have encountered. Therefore you should setup the port forwarding in the connection that you use to run ipython.
如何在用于 运行 ipython 的连接中设置端口转发?
我试过使用我的 IP 地址,但没有成功
$ ssh -N -f -L local_ip_address:8888:127.0.0.1:8889 user@remote_host
最后问题是这样解决的:
# Login to the server from your local workstation and in the same connection do the port forwarding.
user@local$ ssh -L 8888:localhost:8889 username@remote_host
user@remote_host$ ipython notebook --no-browser --port=8889
只需按照此说明操作即可。
https://coderwall.com/p/ohk6cg/remote-access-to-ipython-notebooks-via-ssh