https://www.jianshu.com/p/8fc3cd032d3c本文参考这篇博客
- 首先生成默认配置文件
jupyter notebook --generate-config
- 生成密码
输入python,设置jupyter访问密码
>>>from notebook.auth import passwd
>>>passwd()
Enter password:
Verify password:
'sha1:xxxxxxxxxxxxxxxxx'
复制生成的密钥’sha1:xxxxxxxxxxxxxxxxx’
- 修改./jupyter/jupyter_notebook_config.py文件
c.NotebookApp.ip='*'
c.NotebookApp.password = u'sha:ce...刚才复制的那个密文'
c.NotebookApp.open_browser = False
c.NotebookApp.port =8888 #可自行指定一个端口, 访问时使用该端口
找不到对应行直接添加即可
- 在服务器上启动jupyter notebook
nohup jupyter notebook &
- 打开浏览器,输入http://服务器ip:8888/
注意:如果启动失败,在服务器端输入:
jupyter notebook --ip=服务器ip
然后再次本地浏览器输入:输入http://服务器ip:8888/即可成功