通过SSH隧道尝试访问远程Jupyter Notebook

5

我需要帮助访问远程jupyter笔记本实例。

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

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

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

在Windows上的putty中如何操作?我知道有一些选项在connection>>ssh>>tunnels中可以做到这一点,但我到目前为止无法使配置工作。

2个回答

4
在远程主机中,打开终端,切换到你的笔记本所在的目录,然后输入以下命令:
jupyter notebook --no-browser --port=8889

# you should leave the this open

在您的本地计算机上,打开MS-DOS命令提示符(如果使用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

现在打开网络浏览器(谷歌浏览器,火狐浏览器,……)并输入以下内容:
localhost:8888
# you will see your notebooks in your given directory

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


在我的Windows命令提示符上,ssh命令无法识别。 - Light_B

0

在Windows上通过SSH隧道访问Jupyter,您需要执行以下两个步骤:1)在Putty中初始化隧道,2)配置您的Web浏览器以通过隧道发送流量。

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

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

现在,您应该能够通过SSH隧道访问Jupyter。


这篇博客通过步骤图片的帮助来解释您提到的要点。https://blog.devolutions.net/2017/4/how-to-configure-an-ssh-tunnel-on-putty - Light_B

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接