How to disable password request for a Jupyter notebook session?

前端 未结 9 1322
灰色年华
灰色年华 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 10:51

    If you are trying to run from docker without password just use CMD like bellow:

    CMD ["jupyter", "notebook", "--no-browser","--NotebookApp.token=''","--NotebookApp.password=''"]
    
    0 讨论(0)
  • 2020-12-02 10:54

    The following is very unsafe, but you can remove the password completely with:

    jupyter notebook --ip='*' --NotebookApp.token='' --NotebookApp.password=''
    

    Without --NotebookApp.password='', when connecting from a remote computer to a local Jupyter launched simply with:

    jupyter notebook --ip='*'
    

    it still asks for a password for security reasons, since users with access can run arbitrary Python code on the server machine!

    Note that on my machine, running just:

    jupyter notebook
    

    already opens a logged-in window on my browser, and stdout contains:

        To access the notebook, open this file in a browser:
            file:///home/ciro/.local/share/jupyter/runtime/nbserver-3286-open.html
        Or copy and paste one of these URLs:
            http://localhost:8888/?token=7c9265bf9df5f57cf5da88f410a71b097e2548ae375826b7
         or http://127.0.0.1:8888/?token=7c9265bf9df5f57cf5da88f410a71b097e2548ae375826b7
    

    so if your browser is not opening automatically, you can try one of those links, which seem to have a login token on them, and then investigate why your browser is not opening automatically.

    Tested on Jupyter 4.4.x, Ubuntu 18.04.

    0 讨论(0)
  • 2020-12-02 10:54

    The same issue occured on my machine since the last update of the jupyter-notebook package. After installing version

    jupyter-notebook-4.3.0-1-any.pkg.tar.xz
    

    it prompted me for a password I never set. Downgrading to

    jupyter-notebook-4.2.3-1-any.pkg.tar.xz
    

    worked for me keeping the system a productive environment. Of course this is just a fast patch.

    I also wondered where the password was set since I don't have an explicit config file in my .jupyter-folder. Setting up my own with

    password_required=False
    

    made no difference.

    0 讨论(0)
  • 2020-12-02 10:56

    For me, the solutions described above was not applicable in Docker.

    The following solution works like a charm on Linux:

    Details:

    • used image: tensorflow/tensorflow:latest-py3-jupyter
    • password I configured: 'password'
    • run Jupyter as a user (not root)

    Steps to start Jupyter in Docker with your pre-defined password:

    1. export JUPYTER_TOKEN='password'
    2. docker run -it --rm -p 8888:8888 -u $(id -u ${USER}):$(id -g ${USER}) -e JUPYTER_TOKEN=$JUPYTER_TOKEN -v /home/<user>/jupyter:/tf/ tensorflow/tensorflow:latest-py3-jupyter
    3. open http://localhost:8888 and use 'password' as your password
    4. save password in ypur browser

    For me, that is the easiest way to get rid of the annoying token authentication.

    0 讨论(0)
  • 2020-12-02 10:59

    How to avoid "Invalid credentials" by disabling jupyter Notebook Password & Token

    First open Anaconda Prompt

    1. Enter the command jupyter notebook --generate-config

    1. From jupyter directory ,edit the jupyter_notebook_config.py

    made changes into the following command

     c.NotebookApp.token = ''
     c.NotebookApp.password = u''
     c.NotebookApp.open_browser = True
     c.NotebookApp.ip = 'localhost'
    

    Now launch the jupyter notebook from anaconda navigator definitely the problem will be resolved as soon..

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

    Use the command jupyter notebook password to open jupyter & it asks to enter a new password.

    The hashed password is updated in the jupyter_notebook_config.json file.

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