Fork me on GitHub

JupyterNotebook远程服务认证访问配置

目录

  • 背景

  • 第一部分 生成配置文件

  • 第二部分 个性化配置

  • 第三部分 设置密钥

  • 第四部分 启动

  • 参考文献及资料

背景

Jupyter notebook是数据科学常用的代码交互式工具。

注:环境为ubuntu环境

第一部分 生成配置文件

1
2
root@VM-0-5-ubuntu:~# jupyter notebook --generate-config
Writing default config to: /root/.jupyter/jupyter_notebook_config.py

回显提示了配置文件路径。

1
/root/.jupyter/jupyter_notebook_config.py

第二部分 个性化配置

配置

1
2
3
4
5
6
# 允许远程所有IP地址
c.NotebookApp.allow_origin = '*'
c.NotebookApp.allow_remote_access = True
c.NotebookApp.ip = '0.0.0.0'
c.NotebookApp.open_browser = False
c.NotebookApp.port = 8888

第三部分 设置密钥

建议使用方法2,比较方便。

方法1:

1
2
3
4
5
6
7
8
9
root@VM-0-5-ubuntu:~# python
Python 3.7.0 (default, Jun 28 2018, 13:15:42)
[GCC 7.2.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from notebook.auth import passwd
>>> passwd()
Enter password:
Verify password:
'sha1:0dd92833333333333333333333333333333333333333'

方法2:

1
2
3
root@VM-0-5-ubuntu:~# jupyter notebook password
Enter password:
Verify password:

第四部分 启动

1
root@VM-0-5-ubuntu:~# jupyter notebook

参考文献及资料

1、jupyter官网,链接:https://jupyter.org/

本文标题:JupyterNotebook远程服务认证访问配置

文章作者:rong xiang

发布时间:2022年10月09日 - 19:10

最后更新:2022年10月25日 - 23:10

原始链接:https://zjrongxiang.github.io/posts/59dfcf67/

许可协议: 署名-非商业性使用-禁止演绎 4.0 国际 转载请保留原文链接及作者。

0%