How to disable password request for a Jupyter laptop session?

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

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

When I try to open jupyter in a browser, it asks me for a password, although I have never set it before. It is important to note that if I set the port to a value other than 7000 (eg., the default 8888) , the interface will open without problems

I run jupyter locally and in the following setup:

 Python 3.5.2 

When installing the following modules:

 jupyter (1.0.0), jupyter-client (4.4.0), jupyter-console (5.0.0), jupyter-core (4.2.1), ipykernel (4.5.2), ipython (5.1.0), ipython-genutils (0.1.0), nbconvert (4.3.0), nbformat (4.2.0), notebook (4.3.0) 

NOTE. I don't have jupyter configuration file

Below are some of the output lines from the server:

 [I 19:16:24.358 NotebookApp] Serving notebooks from local directory: /Users/my_user_name [I 19:16:24.358 NotebookApp] 0 active kernels [I 19:16:24.358 NotebookApp] The Jupyter Notebook is running at: http://localhost:7000/?token=aa0dab6e2d85766f3e2e4f0f6633e4473db56a56c94cac76 [I 19:16:24.358 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). 

And the following messages are messages after I try to open it in a browser (using port 7000)

 [I 19:21:56.848 NotebookApp] 302 GET /tree (::1) 8.46ms [D 19:21:56.857 NotebookApp] Using contents: services/contents [D 19:21:56.919 NotebookApp] Path base/images/favicon.ico served from /usr/local/lib/python3.5/site-packages/notebook/static/base/images/favicon.ico [D 19:21:56.920 NotebookApp] Path components/jquery-ui/themes/smoothness/jquery-ui.min.css served from /usr/local/lib/python3.5/site-packages/notebook/static/components/jquery-ui/themes/smoothness/jquery-ui.min.css [D 19:21:56.922 NotebookApp] Path components/jquery-typeahead/dist/jquery.typeahead.min.css served from /usr/local/lib/python3.5/site-packages/notebook/static/components/jquery-typeahead/dist/jquery.typeahead.min.css [D 19:21:56.923 NotebookApp] Path style/style.min.css served from /usr/local/lib/python3.5/site-packages/notebook/static/style/style.min.css [D 19:21:56.925 NotebookApp] Path auth/css/override.css served from /usr/local/lib/python3.5/site-packages/notebook/static/auth/css/override.css [D 19:21:56.926 NotebookApp] Path components/es6-promise/promise.min.js served from /usr/local/lib/python3.5/site-packages/notebook/static/components/es6-promise/promise.min.js [D 19:21:56.926 NotebookApp] Path components/requirejs/require.js served from /usr/local/lib/python3.5/site-packages/notebook/static/components/requirejs/require.js [D 19:21:56.933 NotebookApp] Path base/images/logo.png served from /usr/local/lib/python3.5/site-packages/notebook/static/base/images/logo.png [D 19:21:56.934 NotebookApp] 200 GET /login?next=%2Ftree (::1) 80.86ms [D 19:21:57.001 NotebookApp] Path custom.css served from /usr/local/lib/python3.5/site-packages/notebook/static/custom/custom.css [D 19:21:57.003 NotebookApp] 304 GET /custom/custom.css (::1) 3.11ms [D 19:21:57.341 NotebookApp] Path auth/js/main.min.js served from /usr/local/lib/python3.5/site-packages/notebook/static/auth/js/main.min.js [D 19:21:57.344 NotebookApp] 200 GET /static/auth/js/main.min.js?v=20161219191623 (::1) 3.57ms 

At this point, there is a page from jupyter that asks me to insert a password that I have never set before.

SOLVE!

With the latest update of the laptop module (4.3.1), the problem is resolved.

After starting the jupyter laptop, the user is prompted to insert the URL into the browser the first time they connect:

 Copy/paste this URL into your browser when you connect for the first time, to login with a token: http://localhost:7000/?token=32be0f5ee74cfe521187bc479855ce8b9fbab9e8021701c9 

This solved the problem!

+17
python ipython jupyter-notebook jupyter
Dec 15 '16 at 8:43
source share
7 answers

You can completely remove the password with:

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

Without --NotebookApp.password='' when connecting from a remote computer to a local Jupyter, it starts 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!

Tested on Jupyter 4.4.x.

+19
Nov 27 '17 at 10:56 on
source share

Notebook 4.3.0 includes logon protection by default. The token for entering into the password field is printed at the output of the notebok server at 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 information, including disabling this feature.

However, this does not explain why you get a password request when working on one port, but not on the other.

+6
Dec 16 '16 at 8:19
source share

The same problem has occurred on my machine since the last jupyter-notebook package update. After installing the version

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

he gave me a password that I never set. Rating downgrade

 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 quick patch .

I also wondered where the password was set, since I do not have an explicit configuration file in my .jupyter wand. Create your own

 password_required=False 

irrelevant.

+2
Dec 15 '16 at 16:35
source share

If you are trying to start from docker without a password, just use CMD as shown below:

 CMD ["jupyter", "notebook", "--no-browser","--NotebookApp.token=''","--NotebookApp.password=''"] 
+2
Sep 11 '18 at 6:37
source share

Avoiding “invalid credentials” by disabling the jupyter laptop password and token

The first open Anaconda Prompt

  1. Enter jupyter notebook --generate-config command

enter image description here

  1. From the jupyter directory, edit the jupyter_notebook_config.py file

made changes to the following command

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

Now start up your Anaconda Navigator's Jupyter laptop, and the issue will definitely be resolved soon.

+1
Dec 13 '18 at 14:18
source share

In my case, worked:

In the terminal, run the jupyter notebook list command, which will give Url/s with tokens, now copy the url into it in the browser along with the ie ::/Users/..... token, and it worked.

0
Jun 22 '17 at 2:08 on
source share

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

The following solution works like a charm on Linux:

Details:

  • image used: tensorflow/tensorflow:latest-py3-jupyter
  • the password that I set up is "password"
  • run jupyter as user (not root)

Steps to launch Jupyter in Docker with your predefined 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 the password as the password
  4. save password in ypur browser

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

0
May 05 '19 at 17:05
source share



All Articles