How to disable password request for a Jupyter notebook session?

前端 未结 9 1323
灰色年华
灰色年华 2020-12-02 10:24

I have been launching Jupyter Notebook for years using the following command:

jupyter-notebook --port=7000 --no-browser --no-mathjax

When I t

相关标签:
9条回答
  • 2020-12-02 11:03

    Notebook 4.3.0 has enabled login security by default. The token to enter in the password field is printed in the output of the notebok server during startup (or can be included directly in the URL)

    The Jupyter Notebook is running at: http://0.0.0.0:8888/?token=f3e7fa23fb7e347ad05914368b625416b7a95a674dc078f7
    

    See http://jupyter-notebook.readthedocs.io/en/latest/security.html#server-security for more info, including disabling the feature.

    However, this would not explain why you get the password prompt when running on one port but not on another

    0 讨论(0)
  • 2020-12-02 11:14

    I solved the token authentication by replacing the password inside jupyter_notebook_config.json by running jupyter notebook password on the command line:

    (base) C:\WINDOWS\system32>jupyter notebook list
    http://localhost:8888/ :: C:\Users\320089053
    http://localhost:8889/ :: C:\Users\320089053
    
    (base) C:\WINDOWS\system32>jupyter notebook list
    Enter password:
    Verify password:
    [NotebookPasswordApp] Wrote hashed password to C:\Users\320089053\.jupyter\jupyter_notebook_config.json
    
    0 讨论(0)
  • 2020-12-02 11:16

    You can first create a jupyter config file with:

    cd ~/.jupyter

    jupyter notebook --generate-config Then set the c.NotebookApp.token parameter to an empty string in the configuration file created

    c.NotebookApp.token = ''

    As mentioned in comment, Setting to an empty string disables authentication altogether, which is NOT RECOMMENDED.

    0 讨论(0)
提交回复
热议问题