简体   繁体   English

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

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

I need some help accessing a remote jupyter notebook instance我需要一些帮助来访问远程 jupyter 笔记本实例

normally, when I am trying to access a jupyter notebook running on a remote server on my mac, I will write the following in a terminal window to create the tunnel通常,当我尝试访问在我的 mac 上的远程服务器上运行的 jupyter notebook 时,我会在终端窗口中编写以下内容来创建隧道

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

afterwards, I can usually access the jupyter server at http://localhost:local_port_number之后,我通常可以通过http://localhost:local_port_number访问 jupyter 服务器

how do I do this in putty on windows?我如何在 Windows 上的腻子中执行此操作? I know there is some option in connection>>ssh>>tunnels to do this, but I cannot get the configuration to work so far.我知道 connection>>ssh>>tunnels 中有一些选项可以执行此操作,但到目前为止我无法使配置正常工作。

In remote host, open the terminal, change directory to where you have your notebooks and type:在远程主机中,打开终端,将目录更改为您拥有笔记本的位置并键入:

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

# you should leave the this open

In your local computer, open MS-DOS cmd (if using Windows) or Unix terminal, then type:在本地计算机上,打开 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

Now open web browser (google chrome, firefox, ...) and type:现在打开网络浏览器(google chrome、firefox 等)并输入:

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

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

To access Jupyter over the SSH tunnel on Windows you will need to 1) initiate the tunnel in Putty and 2) configure your web browser to send traffic over the tunnel.要通过 Windows 上的 SSH 隧道访问 Jupyter,您需要 1) 在 Putty 中启动隧道和 2) 配置您的 Web 浏览器以通过隧道发送流量。

To Initiate the tunnel in Putty: 1) Navigate to Connection-->SSH-->Tunnels 2) Put in the local address for which you want to forward traffic 3) Click the 'Dynamic' radio button 4) Click the 'Add' button 5) Click the 'Open' button to initiate the connection在 Putty 中启动隧道: 1) 导航到 Connection-->SSH-->Tunnels 2) 输入要转发流量的本地地址 3) 单击“动态”单选按钮 4) 单击“添加”按钮 5) 单击“打开”按钮启动连接

For Chrome and Internet Explorer 1) Use the Start->Run menu to run inetcpl.cpl 2) In the 'Connections' tab click 'LAN Settings' 3) Click on the 'Use a proxy server for your LAN' check box 4) Click 'Advanced' 5) In the 'Socks' field type '127.0.0.1' and add the port that you chose above 6) Apply these changes by clicking the 'Ok' button对于 Chrome 和 Internet Explorer 1) 使用开始->运行菜单运行 inetcpl.cpl 2) 在“连接”选项卡中单击“局域网设置” 3) 单击“为局域网使用代理服务器”复选框 4)单击“高级” 5) 在“袜子”字段中键入“127.0.0.1”并添加您在上面选择的端口 6) 单击“确定”按钮应用这些更改

You should now be able to access Jupyter over the SSH tunnel.您现在应该可以通过 SSH 隧道访问 Jupyter。

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

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