1.配置项如下
2.如何设置密码
2.1 设置密码
在终端运行 jupyter notebook password,并输入自定义的密码
jupyter notebook password
输入密码并确认后,会生成一个文件,保存在~/.jupyter/jupyter_notebook_config.json路径下,找到这个配置文件后,将以下截图中的对应值,复制到2.2中的c.NotebookApp.password中
2.2 找到对应jupyter notebook配置文件(jupyter_notebook_config.py),并修改以下值
c.NotebookApp.ip = '0.0.0.0' # listen on all IPs,远程访问时需要配置该项
c.NotebookApp.port = 9999 #jupyter监听的端口
c.NotebookApp.open_browser = False #是否在键入`jupyter`时打开浏览器
c.NotebookApp.password = 'argon2:$argon2id$v=19$m=10240,t=10,p=8$dUq2TpCn' #jupyter server密码,生成方法见3的内容。
c.NotebookApp.allow_root = True #是否同意jupyter以root身份运行
2.3 保存好配置文件
将以上文件进行保存,启动jupyter notebook后,即可输入密码进行登录。