How to remove the password for Jupyter laptops and set the token again

I need to do this for Picharma.

Here are the steps that I have taken that I cannot undo.

  1. I added an authentication password using:

    laptop password $ jupyter

  2. Then I used the following command to comment on all of the code in jupyter_notebook_config.py

    $ jupyter notebook --generate-config

  3. Then I deleted the hashed password generated in jupyter_notebook_config.json, which now looks like this

    {"NotebookApp": {"password": ""}}

  4. Then I made the following changes to the jupyter_notebook_config.py file

    c.NotebookApp.password = ''
    c.NotebookApp.token = '<>'

  5. , Jupyter, , .

    Pycharm git: () notebook
    [I 21: 53: 35.158 NotebookApp] : /Users/...
    [I 21: 53: 35.158 NotebookApp] 0
    [I 21: 53: 35.158 NotebookApp] Jupyter :
    [I 21: 53: 35.158 NotebookApp] http://localhost: 8888/? Token =% 3Cgenerated% 3E

    / URL ,
    :
    HTTP://: 8888/ =% 3Cgenerated% 3E

, , , ??

PS - Jupyter, URL . , Mac, , , .

+11
5

, .

,

$ cat ~/.jupyter/jupyter_notebook_config.json
{
  "NotebookApp": {
    "password": "sha1:d0a89f391169:9ca771c3518f845438693b938b39703ce1104eaf"
  }
+7

:

ipython

from IPython.lib import passwd
passwd()

"sha1:12345".

jupyter:

vi ./jupyter/jupyter_notebook_config.py

... .

c.NotebookApp.password='sha1:12345'

Jupyter.

+2

<generated> . , f45cf5d6803b81bcd41bcfbf70130293bcf7a773feabe827.

, :

  • python3 -c 'import os;print(os.urandom(24).hex())' ( Linux/macOS)
  • py -c "import os;print(os.urandom(24).hex())" ( Windows)
0

.config("spark.submit.deployMode", "client")

0

, ( , ), . jupyter notebook list .

, ~/.jupyter/jupyter_notebook_config.py, ~/.jupyter/jupyter_notebook_config.json ( jupyter notebook password), .

, , , : jupyter_notebook_config.py . jupyter notebook list , URL- Jupyter.

, , , @gschizas.

It seems strange that returning token authentication requires adding an empty password entry to the configuration - as if the password set in the past did not allow jupyter to return to its "default token authentication" behavior.

0
source

Source: https://habr.com/ru/post/1692107/


All Articles