本文记录了如何自己搭建一个可以远程访问的jupyter服务器的思路与教程。CV小组的同学可以直接登录本站搭建的lab。
1.开启密钥加密的SSH
2.服务端生成jupyter配置文件
先生成sha1密码
from notebook.auth import passwd
passwd()
cd 到 ~/.jupyter/文件目录下,查看当前目录下是否有jupyter_notebook_config.py 文件,如果没有,则使用 jupyter notebook –generate-config 命令产生一个默认jupyter_notebook_config.py的配置都使用#注释掉,下面需要开启所需要的命令。
## The IP address the notebook server will listen on.
c.NotebookApp.ip = '192.168.1.1'
## The string should be of the form type:salt:hashed-password.
## 这里password 一项要使用前面产生的sha1值
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/users/Jupyter'
3.服务端使用systemctl建立服务
4.客户端使用SSH端口转发登录jupyter
参考
Post Views:
531