• jupyter_远程安装&问题


    安装:

    https://jupyter.readthedocs.io/en/latest/install.html#install

    配置

    Ubuntu 16.04 LTS 配置 Jupyter notebook 为服务器

     

    原材料:

    Ubuntu 16.04 LTS 64bit

    已经配置好 IPython 和 Jupyter (安装步骤可以参照:http://www.cnblogs.com/McKean/p/6194977.html)

    一、使用OpenSSL产生 *.key 和 *.pem 密钥

    cd ~/.jupyter 切换到.jupyter目录

    openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout mykey.key -out mycert.pem

    成功的话,会在.jupyter目录下面产生 mykey.key 和 mycert.pem 两个文件

    注意:这个OpenSSL是可选的,即使不适用OpenSSL也可以配置 jupyter使得局域网里面可以访问的。

    二、设置密钥的sha1码

    可以在IPython里面输入一下命令并按照提示输入密码,即可产生你需要密码对应的sha1值。

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    In [1]: from notebook.auth import passwd
     
    In [2]: passwd()
    c:python27libgetpass.py:92: GetPassWarning: Can not control echo on the termi
    nal.
      return fallback_getpass(prompt, stream)
    Warning: Password input may be echoed.
    Enter password: 12345678
    Warning: Password input may be echoed.
    Verify password: 12345678
    Out[2]: 'sha1:c88810a822cf:2a10d54101bf6b326351c15f0c7b9fede372ef23'

      

    三、产生并配置 jupyter_notebook_config.py 文件

    使用 ls 命令查看.jupyter 目录下面有没有 jupyter_notebook_config.py 文件

    如果没有,则使用 jupyter notebook --generate-config 命令产生一个

    默认jupyter_notebook_config.py的配置都使用#注释掉,下面需要开启所需要的命令。

    这里password 一项要使用前面产生的sha1值## The full path to an SSL/TLS certificate file.c.NotebookApp.certfile = u'/home/peter/.jupyter/mycert.pem

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    ## The IP address the notebook server will listen on.
    c.NotebookApp.ip = '192.168.242.139'
      
    #  The string should be of the form type:salt:hashed-password.
    c.NotebookApp.password = u'sha1:96d749b4e109:17c2968d3bc899fcd41b87eb0853a42ceb48c521'
      
    ## The port the notebook server will listen on.
    c.NotebookApp.port = 8888
     
    c.NotebookApp.open_browser = False

      

    配置Jupyter notebook的默认目录

    1
    c.NotebookApp.notebook_dir = u'/home/peter/Git/MatlabMisc/Jupyter'

      

    四、启动Jupyter notebook

    在~/.jupyter目录下,输入下面命令即可
    sudo jupyter notebook --certfile=mycert.pem --keyfile mykey.key

    然后在其他机器上,输入 https://192.168.242.139:8888 (这里的ip是根据你自己的环境和在jupyter_notebook_config.py 文件配置的ip)

    再输入密码即可

    转载:http://www.cnblogs.com/McKean/p/6391380.html

     
     
     
     
  • 相关阅读:
    jsp int转String or String转int 方法
    log4j详细使用教程
    SQL 查询当天,本月,本周的记录
    1012Linux流编程的一些知识点
    myeclipse过期以后提示过期以后怎么办?!
    mysql常用命令
    Myeclipse文件没出错,但是项目上显示有错的解决办法
    java的一些命名规范吧
    mysql 按照时间查询
    struts1.x和struts2.x之间的一些区别
  • 原文地址:https://www.cnblogs.com/cphmvp/p/7281532.html
Copyright © 2020-2023  润新知