- 配置 Jupyter Notebook:
-
- 如果需要更改默认配置,可以生成并编辑 Jupyter 配置文件。Jupyter 配置文件默认是没有的,执行如下命令生成配置文件:
jupyter notebook --generate-config
-
- 配置文件通常位于 ~/.jupyter/jupyter_notebook_config.py。打开该文件并编辑以下选项:
c.NotebookApp.ip = '0.0.0.0'
c.NotebookApp.port = 8888
c.NotebookApp.open_browser = False
c.NotebookApp.allow_remote_access = True
2. 设置密码或令牌:
-
- 为了安全起见,设置访问密码或使用令牌身份验证。可以通过以下命令设置密码:
jupyter notebook password
-
- 这将提示你输入并确认密码。
对方访问效果: