使用
jupyter notebook password
命令生成密码
Enter password(输入新密码):
Verify password(重复输入密码):默认在用户根目录下生成./jupyter/jupyter_notebook_config.json文件
使用
cat jupyter_notebook_config.json
命令输出jupyter_notebook_config.json
文件的内容{
"NotebookApp": {
"password": "argon2:$argon2id$v=19$m=10240,t=10,p=8$YMuBMI2LRg3tYa1QcuAHmA$sITZLzs8Tr+nH9Qn8oP11tCE4Y9H/dxVL8b65NkfLFA"
}复制password后面的字符串
"argon2:$argon2id$v=19$m=10240,t=10,p=8$YMuBMI2LRg3tYa1QcuAHmA$sITZLzs8Tr+nH9Qn8oP11tCE4Y9H/dxVL8b65NkfLFA"
使用
jupyter notebook --generate-config
命令生成默认配置文件在用户根目录下
.jupyter/jupyter_notebook_config.py
的文件中找到c.NotebookApp.password
这行,取消注释并改为如下:# 示例:
c.NotebookApp.password = u'sha:(jupyter_notebook_config.json文件中password后面的字符串)'
# 修改后
c.NotebookApp.password = u'sha:argon2:$argon2id$v=19$m=10240,t=10,p=8$YMuBMI2LRg3tYa1QcuAHmA$sITZLzs8Tr+nH9Qn8oP11tCE4Y9H/dxVL8b65NkfLFA'重新启动jupyter即可用新密码登录
Jupyter notebook重置密码
作者:亚索的笔记
文章链接:https://www.cvms.cn/2023/01/27/jupyter%E9%87%8D%E7%BD%AE%E5%AF%86%E7%A0%81/
版权声明:本博客所有文章除特别声明外,均采用CC BY-NC-SA 4.0 协议。转载请注明出处!