zoukankan      html  css  js  c++  java
  • 通过ssh远程ipython notebook登录使用服务器

    远程服务器有时候我们这里通过虚拟机登录服务器的winclient会发生冲突,怎么办呢?曲线救国,使用SSH登录。

    首先在远程机器上,启动IPython notebooks服务:

    remote_user@remote_host$ ipython notebook --no-browser --port=8889

    这样完成服务器的设置,当然首先服务器要开通SSH的,这个好像是废话是吧(废话还说?)

    然后在你本地的机器上,怎么使用呢?

    首先,还是需要你本地机器具有使用SSH的功能。windows好像比较麻烦是吧,可以装个MSYS2,我记得以前我还用过Cygwin,xshell。反正可以开通SSH就可以了吧。

    打开msys2本地配置:

    local_user@local_host$ ssh -N -f -L localhost:8888:localhost:8889 remote_user@remote_host

    每个参数的意义:The first option -N tells SSH that no remote commands will be executed, and is useful for port forwarding. The second option -f has the effect that SSH will go to background, so the local tunnel-enabling terminal remains usable. The last option -L lists the port forwarding configuration (remote port 8889 to local port 8888).

    然后打开browser,输入:

    localhost:8888

    于是就可以了。和在服务器上使用ipython notebook几乎一样的。

    最近anaconda继承的ipython notebook加密级别提高了,需要在登录时输入token。这个token是由远程服务器启动时产生的,在远程服务器启动时可以看到有一串token生成,本地机器登录时第一次需要输入的。

    参考:https://coderwall.com/p/ohk6cg/remote-access-to-ipython-notebooks-via-ssh

    http://www.cnblogs.com/naive/p/4877435.html

    PS:最早由同事找到的这种使用方式,使用一两年了,想想我这老年痴呆越来越严重,还是记一下吧。

    转载请注明出处,谢谢。
  • 相关阅读:
    事件基础
    DOM
    GoWeb编程之多路复用
    GoWeb编程之HelloWorld
    Linux libtins 库安装教程
    模式串匹配KMP详解
    树的重心
    Light OJ 1064
    Light OJ 1060
    1057
  • 原文地址:https://www.cnblogs.com/jianyingzhou/p/6872316.html
Copyright © 2011-2022 走看看