内网穿透

1.下载frp

下载系统对应的frp 安装包

2.安装jupyte

## 安装jupyter
conda install -y jupyter
## 生成配置文件
jupyter notebook --generate-config
## 生成密码
jupyter notebook password
Enter password:  xxxx
Verify password: xxxx
## 修改jupyter 配置设置
vi ~/.jupyter/jupyter_notebook_config.py
c.NotebookApp.allow_remote_access = True
c.NotebookApp.ip='*'
c.NotebookApp.open_browser = False
c.NotebookApp.port = 8890
c.NotebookApp.terminals_enabled = True

3.配置IP 端口

公网IP服务器 中修改目录中的 frps.ini 配置文件;在内网IP服务器 中修改 frpc.ini配置文件。

### 公网:frps.ini
[common]
bind_port = 7000
vhost_http_port = 8890
# 下面的是配置可视化界面的,可以通过你的ip:7500访问
dashboard_port = 7500
dashboard_user = mint
dashboard_pwd = xxxxx

### 内网:frpc.ini
[common]
server_addr = 公网IP
server_port = 7000

[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 6000
[jupyter]
type = http
local_ip = 127.0.0.1
local_port = 8890
custom_domains = 公网IP

4.启动服务

公网服务器: nohup ./frps -c ./frps.ini > /dev/null 2>&1 &
内网服务器: nohup ./frpc -c ./frpc.ini > /dev/null 2>&1 &
启动jupyter服务: nohup ./jupyter notebook >/dev/null 2>&1 &

5.连接访问

SSH 访问内网服务器, username 是内网服务器用户名,后面的IP地址则是公网服务器的IP地址 ssh -oPort 6000 username@IP;浏览器访问IP:8890访问jupyter服务;浏览器访问IP:7500访问frps DashBoard

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容