frp下载地址:https://github.com/fatedier/frp/releases?after=v0.31.2
参考:https://blog.csdn.net/yangdashi888/article/details/111403730 https://www.cnblogs.com/cxfs/p/13071969.html
分为两部分配置(云服务器配置、树莓派配置)
一、服务端配置(云服务器,带有公网IP)
1. 下载frp
wget https://github.com/fatedier/frp/releases/download/v0.29.1/frp_0.29.1_linux_amd64.tar.gz
2. 创建一个目录并解压frp
mkdir frp
tar -zxvf frp_0.29.1_linux_amd64.tar.gz -C /usr/yanqb/frp/
3. 进入frp 目录,修改frps.ini 文件
[common]
bind_port = 7000
dashboard_port = 7500
dashboard_user = root
dashboard_pwd = root
4. 开启frps
./frps -c ./frps.ini
二、客户端配置(局域网内电脑)
1. 下载frp
https://github.com/fatedier/frp/releases?after=v0.31.2
2. 解压frp文件(D:Program Files_JAVAfrp_0.29.1_windows_amd64),修改frpc.ini 文件
[common]
server_addr = 139.xx.xx.xx
server_port = 7000
[RDP]
type = tcp
local_ip = 127.0.0.1
local_port = 3389
remote_port = 33389
[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 6000
3. 开启frpc
cmd到frp目录下,执行 frpc.exe -c frpc.ini
注意:
1. 开启用到的端口防火墙;(阿里云配置安全规则,把端口开放)开放范围5000-8888即可
2. Windows远程访问;
测试1:ip:8181 访问到的是 树莓派8080
测试2:ssh连接树莓派(139.xx.xx.xx:6000)账号密码