原材料:

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值。

In [1]: from notebook.auth import passwd

In [2]: passwd()
c:\python27\lib\getpass.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

## 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的默认目录

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)

再输入密码即可

Ubuntu 16.04 LTS 配置 Jupyter notebook 为服务器的更多相关文章

  1. Ubuntu 16.04远程配置Jupyter Notebook

    安装和配置Jupyter Notebook 安装jupyter notebook conda conda install -c conda-forge notebook pip pip install ...

  2. Ubuntu 16.04 LTS 安装 Nginx/PHP 5.6/MySQL 5.7 (LNMP) 与Laravel

    Ubuntu 16.04 LTS 安装 Nginx/PHP 5.6/MySQL 5.7 (LNMP) 与Laravel 1.MySQL安装[安装 MariaDB]MariaDB是MySQL的一个分支首 ...

  3. tips of my ubuntu 16.04 LTS

    update_0 : sudo .../idea.sh 才会把idea安装上,不加sudo也会启动,但是不会在开始菜单中找到程序. ---------------------------------- ...

  4. Ubuntu 16.04 LTS安装好需要设置的15件事(喜欢新版本)

    看到这篇文章说明你已经从老版本升级到 Ubuntu 16.04 或进行了全新安装,在安装好 Ubuntu 16.04 LTS 之后建议大家先做如下 15 件事.无论你是刚加入 Ubuntu 行列的新用 ...

  5. Ubuntu 16.04 LTS 降级安装GCC 4.8

    转载自https://www.linuxidc.com/Linux/2017-03/142299.htm Ubuntu 16.04 LTS 降级安装GCC 4.8 [日期:2017-03-28] 来源 ...

  6. Ubuntu 16.04 LTS 搭建ftp服务器

    其实我之前搭建好了,但是最近我上来看好像跟没搭建一样呢,于是我从新搭建一遍? 我的ubuntu版本: cat /etc/issue Ubuntu 16.04 LTS \n \l 1.安装vsftpd( ...

  7. EJBCA的安装(基于Ubuntu 16.04 LTS + wildfly8 + ejbca6.3.11 + jdk7)

    前一段时间折腾了一下PKI,用EJBCA在研究院内网搭建了一个CA,目前是提供给手机端(安卓和IOS)来和服务器端(nginx + Java应用)做安全连接的(客户端和服务器端双向认证) 由于EJBC ...

  8. Ubuntu 16.04 LTS安装好之后需要做的15件事

    看到这篇文章说明你已经从老版本升级到 Ubuntu 16.04 或进行了全新安装,在安装好 Ubuntu 16.04 LTS 之后建议大家先做如下 15 件事.无论你是刚加入 Ubuntu 行列的新用 ...

  9. Ubuntu 16.04 LTS 一键安装VNC

    Ubuntu 16.04 LTS 安装VNC,在百度和谷歌找了很多教程,不是太老,就是说的驴唇不对马嘴,所以忍不住写一些以正视听. Ubuntu 16.04 LTS是最近出的LTS版本系统,估计未来也 ...

随机推荐

  1. Linux下配置MySQL主从复制

    一.环境准备 本次准备两台Linux主机,操作系统都为CentOS6.8, 都安装了相同版本的MySQL.(MySQL5.7). 主从服务器的防火墙都开启了3306端口. 相关信息如下: [主服务器] ...

  2. PYDay3-初识python

    Python 种类 c.j.iron.ruby等,主要有三类:cpython.xxxpython.pypy 种类繁多我们精通一种即可 编译流程: py代码->字节码->机器码->计算 ...

  3. BZOJ 2440 [中山市选2011]完全平方数 ——莫比乌斯函数

    $\sum_{i=1}^n[i==d^2*p]$ 其中p无平方因子$=\sum_{d^2\mid n,d>=2}\sum_{i=1}^{\lfloor {n/d^2} \rfloor} \lef ...

  4. SPOJ QTREE4 Query on a tree IV ——动态点分治

    [题目分析] 同bzoj1095 然后WA掉了. 发现有负权边,只好把rmq的方式改掉. 然后T了. 需要进行底(ka)层(chang)优(shu)化. 然后还是T 下午又交就A了. [代码] #in ...

  5. 算法复习——LCA模板(POJ1330)

    题目: Description A rooted tree is a well-known data structure in computer science and engineering. An ...

  6. UVa1363 Joseph's Problem

    把整个序列进行拆分成[k,k/2),[k/2, k/3), [k/3,k/4)...k[k/a, k/b)的形式,对于k/i(整除)相同的项,k%i成等差数列. /*by SilverN*/ #inc ...

  7. Codevs 3111 CYD啃骨头

    时间限制: 1 s   空间限制: 128000 KB   题目等级 : 黄金 Gold 题目描述 Description: CYD吃饭时有N个骨头可以啃,但CYD要午睡了,所以他只有M分钟吃饭,已知 ...

  8. Python入门--番外--中文目录乱码问题

    写Python的程序,读取含有中文目录下的文件,结果发现根本读取不了该中文目录下的文件, 原因:通过调试发现:该文件的目录乱码,目录无法解析,自然导致无法读取文件内容 解决方法: strPath = ...

  9. yii 之数据库关联查询

    <?php namespace app\controllers; use yii\web\Controller; use app\models\Customer; class CustomerC ...

  10. SSH: Transferred 0 file(s) 解决

    Jenkins搭建过程中,使用 Publish Over SSH 插件.发生 SSH: Transferred 0 file(s). 百度.google了几个小时,终于找到答案,特此记录. 配置如下: ...