- 登录远程服务器
$ ssh test@10.219.118.63
- 生成配置文件
$ jupyter notebook --generate-config
- 生成密码
$ ipython
In [1]: from notebook.auth import passwd
In [2]: passwd() #需要输入密码
Enter password:
Verify password:
Out[2]: 'sha1:368a0fb6eef4:720baa4f5e5bd195a7fa088xxxx1'
- 修改默认配置文件
$ vim ~/.jupyter/jupyter_notebook_config.py
# 进行如下修改
c.NotebookApp.ip='10.219.8.254'
c.NotebookApp.password=u'sha1:368a0fb6eef4:720baa4f5e5bd195a7fa088xxxx1'
c.NotebookApp.open_brower=False
c.NotebookApp.port=8888
- 启动jupyterbook:
$ jupyter notebook --allow-root
[I 12:03:11.888 NotebookApp] Serving notebooks from local directory: /home/test/work
[I 12:03:11.888 NotebookApp] 0 active kernels
[I 12:03:11.888 NotebookApp] The Jupyter Notebook is running at:
[I 12:03:11.888 NotebookApp] http://10.219.118.63:8888/
[I 12:03:11.888 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[I 12:03:28.086 NotebookApp] 302 GET / (10.219.118.12) 0.65ms
[I 12:03:28.111 NotebookApp] 302 GET /tree? (10.219.118.12) 0.68ms
[I 12:03:33.263 NotebookApp] 302 POST /login?next=%2Ftree%3F (10.219.118.12) 1.42ms
- 在本地打开浏览器,输入
http://10.219.118.63:8888/
即可看到服务器上的所有文件夹,并可用过jupyter notebook 运行python,shell脚本,另外可用显示功能(而直接ssh远程登录服务器是不能显示图像的)