1. 服务器
生成jupyter配置文件
jupyter notebook --generate-config
生成jupyter配置文件之后,给jupyter设置一个密码
jupyter notebook password
输入的密码会保存到 .jupyter/jupyter_notebook_config.json文件中
注意:本操作为自动设置密码,即后面不用在配置文件中单独配置密码
设置远程ip可访问
打开jupyter_notebook_config.py文件(jupyter_notebook_config.py应该在.jupyter路径下),在文件中加入如下几行
c.NotebookApp.ip = '*' #允许所有ip访问,很重要
c.NotebookApp.open_browser = False #不打开浏览器
c.NotebookApp.port = 8888 #端口为8888,可以自己设置
启动jupyter notebook
2. 主机
ssh连接:
ssh -L 8888:10.102.64.37:8888 gy@10.102.64.37