繁体   English   中英

尝试通过 ssh 隧道访问远程 jupyter notebook

[英]Trying to access remote jupyter notebook via ssh tunnel

我需要一些帮助来访问远程 jupyter 笔记本实例

通常,当我尝试访问在我的 mac 上的远程服务器上运行的 jupyter notebook 时,我会在终端窗口中编写以下内容来创建隧道

ssh -NL $local_port_number:localhost:$remote_port_number $my_username@$remote_server

之后,我通常可以通过http://localhost:local_port_number访问 jupyter 服务器

我如何在 Windows 上的腻子中执行此操作? 我知道 connection>>ssh>>tunnels 中有一些选项可以执行此操作,但到目前为止我无法使配置正常工作。

在远程主机中,打开终端,将目录更改为您拥有笔记本的位置并键入:

jupyter notebook --no-browser --port=8889

# you should leave the this open

在本地计算机上,打开 MS-DOS cmd(如果使用 Windows)或 Unix 终端,然后键入:

ssh -N -f -L localhost:8888:localhost:8889 username@your_remote_host_name

# make sure to change `username` to your real username in remote host
# change `your_remote_host_name` to your address of your working station
# Example: ssh -N -f -L localhost:8888:localhost:8889 laura@cs.rutgers.edu

现在打开网络浏览器(google chrome、firefox 等)并输入:

localhost:8888
# you will see your notebooks in your given directory

来自: http : //amber-md.github.io/pytraj/latest/tutorials/remote_jupyter_notebook

要通过 Windows 上的 SSH 隧道访问 Jupyter,您需要 1) 在 Putty 中启动隧道和 2) 配置您的 Web 浏览器以通过隧道发送流量。

在 Putty 中启动隧道: 1) 导航到 Connection-->SSH-->Tunnels 2) 输入要转发流量的本地地址 3) 单击“动态”单选按钮 4) 单击“添加”按钮 5) 单击“打开”按钮启动连接

对于 Chrome 和 Internet Explorer 1) 使用开始->运行菜单运行 inetcpl.cpl 2) 在“连接”选项卡中单击“局域网设置” 3) 单击“为局域网使用代理服务器”复选框 4)单击“高级” 5) 在“袜子”字段中键入“127.0.0.1”并添加您在上面选择的端口 6) 单击“确定”按钮应用这些更改

您现在应该可以通过 SSH 隧道访问 Jupyter。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM