登录搬瓦工
$ jupyter notebook --generate-config # 生成配置文件
Writing default config to: /home/iosdevlog/.jupyter/jupyter_notebook_config.py
$ vim ~/.jupyter/jupyter_notebook_config.py # 这个文件里面有详细说明
$ ipython # 配置密码
Python 3.6.6 (default, Jun 28 2018, 04:42:43)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.5.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:***'
In [3]: quit()
$ vim ~/.jupyter/jupyter_notebook_config.py
c.NotebookApp.ip = '*' # 任意 ip 都可以访问
c.NotebookApp.password = u'sha1:***' # 刚才生成的密码
c.NotebookApp.open_browser = False #默认不打开浏览器
c.NotebookApp.port = 8888 # 随便指定一个你想要的端口,后面可以从这个端口使用
$ nohup jupyter notebook & # 后台 jupyter notebook
[1] 23441
$ nohup: ignoring input and appending output to 'nohup.out'
本地浏览器输入: http://67.218.132.50:8888
jupyter notebook.png