内网穿透

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

你可能感兴趣的:(内网穿透)