树莓派4B 安装frp内网穿透连接ssh和vnc

frp

https://github.com/fatedier/frp

frp is a fast reverse proxy to help you expose a local server behind a NAT or firewall to the Internet. As of now, it supports TCP and UDP, as well as HTTP and HTTPS protocols, where requests can be forwarded to internal services by domain name.

服务器端安装(Ubuntu18.04)

sudo apt-get update && sudo apt-get upgrade -y

## 下载frp
wget https://github.com/fatedier/frp/releases/download/v0.32.0/frp_0.32.0_linux_amd64.tar.gz
## 解压 删除压缩包 重命名文件夹
tar -zxvf frp_0.32.0_linux_amd64.tar.gz
rm frp_0.32.0_linux_amd64.tar.gz
mv frp_0.32.0_linux_amd64 frp
## 进入frp文件夹
cd frp

树莓派端安装(Raspbian buster)

sudo apt-get update && sudo apt-get upgrade -y

wget https://github.com/fatedier/frp/releases/download/v0.32.0/frp_0.32.0_linux_arm.tar.gz
## 解压
tar -zxvf frp_0.32.0_linux_arm.tar.gz 
rm frp_0.32.0_linux_arm.tar.gz 
mv frp_0.32.0_linux_arm/ frp

服务器端的配置

frpc.ini

[common]
server_addr = XXXXX96.com      #换成自己的服务器ip
server_port = 233

[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 222

[vnc]
type = tcp
local_ip = 127.0.0.1
local_port = 5900
remote_port = 5900

树莓派4B 安装frp内网穿透连接ssh和vnc_第1张图片

客户端配置

frps.ini

[common]
bind_port = 233     

在这里插入图片描述

启动服务器与客户端

## ubuntu
$ ./frps -c ./frps.ini

## 树莓派
pi@raspberrypi:~/frp $ ./frpc -c ./frpc.ini 

在这里插入图片描述

测试

树莓派4B 安装frp内网穿透连接ssh和vnc_第2张图片

你可能感兴趣的:(树莓派,shell,linux)