【问题标题】:Trying to access remote jupyter notebook via ssh tunnel尝试通过 ssh 隧道访问远程 jupyter notebook
【发布时间】:2016-05-24 23:57:39
【问题描述】:

我需要一些帮助来访问远程 jupyter notebook 实例

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

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

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

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

【问题讨论】:

    标签: ssh putty jupyter-notebook tunnel


    【解决方案1】:

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

    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

    【讨论】:

    • ssh 命令在我的 Windows 命令提示符下无法识别
    【解决方案2】:

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

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

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

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

    【讨论】:

    猜你喜欢
    • 2019-07-15
    • 1970-01-01
    • 1970-01-01
    • 2019-08-07
    • 1970-01-01
    • 2017-12-26
    • 2016-09-25
    • 2018-06-09
    • 2014-12-15
    相关资源
    最近更新 更多