Frp内网穿透+jupyter Notebook 远程连接

前言

上一篇文章记录了如何利用frp实现内网穿透从而远程访问Linux主机,本文介绍如何在此基础上远程连接jupyter notebook

更改frp的设置

更改外网服务器设置

登入外网服务器,打开frps.ini如下设置:

1
2
3
[common]
bind_port = 7000
vhost_http_port = 8888(加上这一行)

保存重启

更改内网服务器设置

打开frpc.ini,加上如下设置:

1
2
3
4
5
# 这个是对于穿透jupyter配置
[jupyter]
type = http
local_port = 8888
custom_domains = 公网服务器ip

保存重启

更改jupyter notebook 设置

设置密码:

1
jupyter notebook

打开生成的 jupyter_notebook_config.json,在.jupyter下,复制生成密码的hash结果
打开jupyter_notebook_config.py,取消注释并更改以下

1
2
3
4
c.NotebookApp.ip='0.0.0.0'
c.NotebookApp.password = u'刚才复制的那个密文'
c.NotebookApp.open_browser = False
c.NotebookApp.port =8888

在内网服务器打开jupyter,或者远程ssh连接后打开jupyter。
在远程电脑打卡浏览器,输入“外网服务器ip:8888” 即可打开jupyter。

参考资料

远程访问jupyter notebook:https://blog.csdn.net/kunlong0909/article/details/52464495
jupyter notebook + frp 实现内容穿透:https://blog.csdn.net/martind/article/details/82716445

Author: Shuchen
Link: http://yoursite.com/2019/07/23/frp%E5%86%85%E7%BD%91%E7%A9%BF%E9%80%8F+jupyter-notebook%E8%BF%9C%E7%A8%8B%E8%BF%9E%E6%8E%A5/
Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.