欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

ubuntu20.04配置安装frp

程序员文章站 2022-07-14 20:12:49
...

1.frp GitHub网址

https://github.com/fatedier/frp

2.下载

wget https://github.com/fatedier/frp/releases/download/v0.38.0/frp_0.38.0_linux_amd64.tar.gz

3.安装

#解压缩
tar -vxzf frp_0.38.0_linux_amd64.tar.gz
cd frp_0.38.0_linux_amd64
#复制执行文件
sudo cp frpc frps /usr/bin/
#复制配置文件
sudo mkdir /etc/frp
sudo cp frp*.ini /etc/frp
#复制系统服务文件
sudo cp systemd/* /lib/systemd/system/
#启动frp客户端
sudo systemctl start frpc
#启动frp服务端
sudo systemctl start frps
#配置开机启动
sudo systemctl enable frpc

4.frpc.ini配置文件

[common]
server_addr = xx.xx.xx.xx   	#公网服务器ip
server_port = xxxx				#服务器端口号
token = 123456   
tls_enable = true

[windows10_rdp]
type = tcp
local_ip = 127.0.0.1
local_port = 3389
remote_port = 13389
use_compression = true

[windows10_ftp21]
type = tcp
local_ip = 127.0.0.1
local_port = 21
remote_port = 2121
use_compression = true

[range:windows10_ftp]
type = tcp
local_ip = 127.0.0.1
local_port = 50000-50002
remote_port = 50000-50002
use_compression = true

[windows10_web]
type = http
local_port = 80
custom_domains = yourdomain.cn
use_compression = true

[ubuntu20.04_ssh]
type = tcp
local_ip = 192.168.1.122
local_port = 22
remote_port = 2222
use_compression = true

[ubuntu20.04_desktop]
type = tcp
local_ip = 192.168.1.122
local_port = 3389
remote_port = 23389
use_compression = true

5.frps.ini文件

[common]
bind_port = xxxx				#服务端端口号
dashboard_port = 7500
vhost_http_port = 8080
token = 123456
dashboard_user = 123
dashboard_pwd = 123