root@iZuf6e9bjg74ll9e9hcyagZ:~/anaconda# ipython
Python 3.6.5 |Anaconda, Inc.| (default, Apr 29 2018, 16:28:17)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.4.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: from notebook.auth import passwd
In [2]: passwd()
Enter password:
Verify password:
Out[2]: 'sha1:ebfc56bf554a:75306bbb99826373ff0b2e0f6c53ae21e61bf450'
In [3]: exit()
5. 配置Jupyter
root@iZuf6e9bjg74ll9e9hcyagZ:~/anaconda# jupyter notebook --allow-root --generate-config
Writing default config to: /root/.jupyter/jupyter_notebook_config.py
root@iZuf6e9bjg74ll9e9hcyagZ:~/anaconda# vi /root/.jupyter/jupyter_notebook_config.py
6. jupyter_notebook_config.py配置
## The directory to use for notebooks and kernels.
c.NotebookApp.notebook_dir = '/root/jupyterworkspace'
## Hashed password to use for web authentication.
#
# To generate, type in a python/IPython shell:
#
# from notebook.auth import passwd; passwd()
#
# The string should be of the form type:salt:hashed-password.
c.NotebookApp.password = 'sha1:ebfc56bf554a:75306bbb99826373ff0b2e0f6c53ae21e61bf450'
## The port the notebook server will listen on.
c.NotebookApp.port = 8888
## The IP address the notebook server will listen on.
c.NotebookApp.ip = '*'