Root Access for Jupyter / iPython Notebook

I am trying to use the bash core in the iPython / Jupyter notebook, but I need sudo access in the notebook itself.

I tried $ sudo jupyter notebookto start the laptop as root, but this only returns:

$ jupyter: 'notebook' is not a Jupyter command

So, I still have it running $ jupyter notebook(unless there is a way to run Jupyter notebook as root).

I also can not do su rootin the notebook itself, because it requires input, and the notebook does not allow me to type.

Finally, there is supposedly a --allow-rootJupyter notebook: http://jupyter-notebook.readthedocs.io/en/latest/config.html

However, it seems that it is --allow_rootno longer an option. (I tried to modify the configuration file by adding NotebookApp.allow_root=True, but this does not work.)

Any ideas guys? Maybe I'm doing something wrong?

+5
source share
5 answers

Add c.NotebookApp.allow_root=Truefrom the root configuration files. What you do not need to request allow-rootevery time you start the laptop.

Edit:

Before editing the configuration file, you need to run jupyter notebook --generate-configas root to create the file.

+3
source

Just log in as the root user, and then run the following command to start the laptop:

jupyter notebook --allow-root
0

sudo jupyter notebook --allow-root, , . , , , , jupyter notebook password .

0

root @user # jupyter notebook --generate-config

root/.jupyter/jupyter_notebook_config.py root @user # cd.jupyter/root @user:/. jupyter/# gedit jupyter_notebook_config.py jupyter_notebook_config.py

c.NotebookApp.allow_root = True

0

, .

sudo -E env "PATH=$PATH" jupyter notebook

Basically, the binary for the call jupyter notebookis in the user PATH, but not for root.

Regards.

0
source

Source: https://habr.com/ru/post/1666661/


All Articles