由于服务器安装的miniconda3,无jupyter notebook,所以手工安装jupyter notebook
1 先conda 安装相关包
在base 环境下
conda install ipython
conda install jupyter notebook
2 生成配置文件
jupyter notebook --generate-config
Writing default config to: /home/***/.jupyter/jupyter_notebook_config.py
3 生成密码
此处不再配置字体
然后配置网络访问的密码
jupyter notebook password
Enter password:
Verify password:
[JupyterPasswordApp] Wrote hashed password to /home/***/.jupyter/jupyter_server_config.json
打开上述文件,获取密文密码
{
"IdentityProvider": {
"hashed_password": "argon2:$argon2id$v=19$m=10240,t=10,p=8***"
}
}
然后打开/home/***/.jupyter/jupyter_notebook_config.py
配置密码也可以python 脚本执行
输入python进入python脚本
from notebook.auth import passwd
passwd()
Enter password
Verify password
从而得到密码,两者方式是一样的
4 修改配置文件
/home/***/.jupyter/jupyter_notebook_config.py 修改如下配置
c.ServerApp.notebook_dir = '/' #设置启动目录为根目录
c.ServerApp.ip = '*' #代表本机上的所有IP地址
c.ServerApp.open_browser = True #设置浏览器打开
c.ServerApp.password = 'argon2:$argon2id$v=19$m=10240,t=10,p=8***' #密码
c.ServerApp.password_required = True #打开是需要密码
c.ServerApp.port = 15290 #15290是端口
5 开启服务并验证
服务器上输入jupyter notebook
然后输入对应的IP地址和端口
输入密码后登录
参考文献:
1 miniconda安装jupyter notebook及初始配置_miniconda 安装jupyternotebook-CSDN博客
2 https://www.cnblogs.com/pychina/articles/12122710.html
3 https://www.cnblogs.com/catting123/p/16557462.html
4 [1026]设置 jupyter notebook 外网远程访问_jupyter notebook 允许外面的-CSDN博客
5 在个人PC上搭建jupyter服务并配置远程访问_jupyter 局域网访问-CSDN博客