如何删除Jupyter Notebook的密码并再次设置令牌 [英] How to remove password for Jupyter Notebooks and set token again
问题描述
我需要为皮查姆做这件事.
I need to do this for Pycharm.
以下是我无法撤消的步骤.
Here are the steps that I did which I'm not able to undo.
-
我添加了密码,用于使用以下方式进行身份验证:
I added a password for authentication using:
$ jupyter笔记本密码
$ jupyter notebook password
然后我使用以下命令注释jupyter_notebook_config.py
I then used the below command to comment all the code in jupyter_notebook_config.py
$ jupyter笔记本--generate-config
$ jupyter notebook --generate-config
然后,我删除了在jupyter_notebook_config.json中生成的哈希密码,现在看起来像这样
Then I removed the hashed password generated in the jupyter_notebook_config.json which now looks like this
{ "NotebookApp":{ 密码": "" } }
{ "NotebookApp": { "password": "" } }
然后我在jupyter_notebook_config.py文件中进行了以下更改
c.NotebookApp.password =''
c.NotebookApp.token ='<生成的>'
c.NotebookApp.password = ''
c.NotebookApp.token = '< generated>'
现在,启动Jupyter笔记本时,没有令牌生成,也没有密码.
Now, There is no token getting generated and there is no password as well when I start the Jupyter notebook.
Pycharm git:(master)✗jupyter笔记本
[I 21:53:35.158 NotebookApp]从本地目录服务笔记本:/Users/...
[I 21:53:35.158 NotebookApp] 0个活动内核
[I 21:53:35.158 NotebookApp] Jupyter Notebook在以下位置运行:
[我21:53:35.158 NotebookApp] http://localhost:8888/?token =%3Cgenic% 3E
首次连接时,将此URL复制/粘贴到浏览器中,
用令牌登录:
http://localhost:8888/?token =%3Cgenic%3E
Pycharm git:(master) ✗ jupyter notebook
[I 21:53:35.158 NotebookApp] Serving notebooks from local directory: /Users/...
[I 21:53:35.158 NotebookApp] 0 active kernels
[I 21:53:35.158 NotebookApp] The Jupyter Notebook is running at:
[I 21:53:35.158 NotebookApp] http://localhost:8888/?token=%3Cgenerated%3E
Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
http://localhost:8888/?token=%3Cgenerated%3E
现在,如何使其恢复原状或如何获得令牌?
PS-我什至尝试了 jupyter笔记本列表,但仍然有相同的URL.另外,我正在Mac上执行此操作,因此请提供相应的建议.
PS - I even tried jupyter notebook list, but still the same URL is coming. Also, I'm doing this on a mac, so please advise accordingly.
推荐答案
嗯,我的配置看起来不一样.
Hmm my config looks different.
只需删除该文件,它将默认为制作令牌
Just remove this file and it will default to making a token
$ cat ~/.jupyter/jupyter_notebook_config.json
{
"NotebookApp": {
"password": "sha1:d0a89f391169:9ca771c3518f845438693b938b39703ce1104eaf"
}
这篇关于如何删除Jupyter Notebook的密码并再次设置令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!