Ubuntu上操作:
1. jupyter notebook --generate-config
2. 生成密码

3.vi /【路径】/.jupyter/jupyter_notebook_config.py
修改四项
c.NotebookApp.ip = '*'
c.NotebookApp.password = u'sha1:bcd259ccf...<your hashed password here>'
c.NotebookApp.open_browser = False
c.NotebookApp.port = 9999
#端口号随意
4. 启动
jupyter notebook
Win上操作:
浏览器输入 ip:端口号 访问
如192.168.1.1:8899
如果直接输入无法连接,则需要利用ssh进行连接:
1. 安装OpenSSH组件


2. 打开cmd

3. 输入ssh -N -f -L localhost:8888:localhost:8889 remote_user@remote_host
前面是win,后面是linux,看情况改端口号
remote_user@remote_host改成自己的用户名和服务器IP地址

4. 打开浏览器,输入地址:http://localhost:8888/
参考:
https://jupyter-notebook.readthedocs.io/en/latest/public_server.html#notebook-public-server
https://zhuanlan.zhihu.com/p/33420241
https://www.bilibili.com/read/cv1420735/
网友评论