How to remove password for Jupyter Notebooks and set token again

I had a situation where I wanted token-based authentication (the default if you don't specify a password) but I kept getting a password form in the browser. And jupyter notebook list was showing an empty token.

I made sure I had no password entry in ~/.jupyter/jupyter_notebook_config.py and I deleted the ~/.jupyter/jupyter_notebook_config.json file (created when jupyter notebook password is run) but I was still getting the password form after restarting the service.

What seemed to finally resolve things was putting a blank password entry into jupyter_notebook_config.py and restarting the service. After that, jupyter notebook list starting showing the autogenerated token, and the token was shown in the startup log when the Jupyter URL was output.

Once the autogenerated token starts showing, if you want to specify the token, do as @gschizas describes.

It seems odd that it takes adding a blank password entry to the config to get the token authentication to come back--as if having a password set in the past prevents jupyter from reverting to its "token authentication by default" behavior.


Run in shell:

ipython

from IPython.lib import passwd
passwd()

Enter the password twice and copy the 'sha1:12345' code.

After that, edit jupyter config file:

vi ./jupyter/jupyter_notebook_config.py

... and alter the password.

c.NotebookApp.password='sha1:12345'

Paste your 'sha' code and run jupyter notebook.


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"
  }