How to specify the same token on jupyter-notebook server?

Viewed 1140

I always have to restart a jupyter-notebook server on reboot or failure and as expected it starts with a different token, but this ruins the link for my existing users. Is there a way to specify the same token everytime?

If not, what is the alternative?

3 Answers

RE: The question, "Is there a way to specify the same token everytime?"

Start jupyter notebook as you normally do. That information is not in the question. So my answer and example is based on:

  1. Activate a conda environment
  2. Use a port number so users can add a link in their browser.
  3. Start jupyter notebook
  4. Copy the token
  5. Use the command line to start jupyter notebook.

Example:

jupyter notebook --port=9000 --NotebookApp.token='6c4bfd9ffd59618566557195d0f0a733f246545b8b118ca7'

From here:

https://jupyter-notebook.readthedocs.io/en/stable/public_server.html

As of notebook 5.3, the first time you log-in using a token, the notebook server should give you the opportunity to setup a password from the user interface.

You will be presented with a form asking for the current token, as well as your new password ; enter both and click on Login and setup new password.

Next time you need to log in you’ll be able to use the new password instead of the login token, otherwise follow the procedure to set a password from the command line.

Ohk, so what you can do is, disable the token and password for the jupyter notbook by passing these arguments --NotebookApp.token='' --NotebookApp.password=''

Related