远程服务器上操作
生成配置文件
jupyter notebook --generate-config
E:\credher\gitee
(python) λ jupyter notebook --generate-config
Overwrite C:\Users\hncjy\.jupyter\jupyter_notebook_config.py with default config? [y/N]y
Writing default config to: C:\Users\hncjy\.jupyter\jupyter_notebook_config.py
生成密码
从jupyter notebook5.0开始提供了一个命令来自动完成密码设置
jupyter notebook password
(python) λ jupyter notebook password
Enter password:
Verify password:
[NotebookPasswordApp] Wrote hashed password to C:\Users\hncjy\.jupyter\jupyter_notebook_config.json
修改配置文件
打开配置文件默认位于C:\Users\用户名.jupyter下的jupyter_notebook_config.json
在其中添加:
c.NotebookApp.ip = "*" # * 表示所有IP都可以访问
c.NotebookApp.port = 8888 # 指定访问端口
c.NotebookApp.allow_remote_access = True # 允许远程访问
本地访问
- 远程服务器中运行jupyter notebook
jupyter notebook
- 查看远程服务器的ip地址
ip addr
- 在本机浏览器中输入ip:port会弹出输入密码,就可以使用了
192.168.33.11:8888