jupyter notebook设置远程访问权限

1. 生成配置文件

jupyter notebook --generate-config

我们生成了一个文件/.jupyter/jupyter_notebook_config.py

2. 使用python生成密码

In [1]: from IPython.lib import passwd

In [2]: passwd()

Enter password:

Verify password:

Out[2]: 'sha1:0e422dfccef2:84cfbcbb3ef95872fb8e23be3999c123f862d856'

3. 修改配置文件

$vim ~/.jupyter/jupyter_notebook_config.py

然后修改以下选项

c.NotebookApp.ip='*'

c.NotebookApp.password = u'sha1:0e422dfccef2:84cfbcbb3ef95872fb8e23be3999c123f862d856' # 就是把引号里边的内容替换成刚才生成的密码

c.NotebookApp.open_browser = False

c.NotebookApp.port =8888 

大功告成

你可能感兴趣的:(Python)