适用于 CentOS/Debian/Ubuntu/Fedora (32bit/64bit)
脚本代码地址: https://github.com/MvsCode/frp-onekey

Frps安装

安装

1
2
3
wget https://raw.githubusercontent.com/MvsCode/frp-onekey/master/install-frps.sh -O ./install-frps.sh
chmod 700 ./install-frps.sh
./install-frps.sh install

卸载

1
./install-frps.sh uninstall

更新

1
./install-frps.sh update

服务管理

1
Usage: /etc/init.d/frps {start|stop|restart|status|config|version}

服务端 [frps.ini]

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# [common] is integral section
[common]
# A literal address or host name for IPv6 must be enclosed
# in square brackets, as in "[::1]:80", "[ipv6-host]:http" or "[ipv6-host%zone]:80"
bind_addr = 0.0.0.0
bind_port = ****
bind_udp_port = ****
# udp port used for kcp protocol, it can be same with 'bind_port'
# if not set, kcp is disabled in frps
kcp_bind_port = ****
# if you want to configure or reload frps by dashboard, dashboard_port must be set
dashboard_port = ****
# dashboard assets directory(only for debug mode)
dashboard_user = ****
dashboard_pwd = ******
# assets_dir = ./static
vhost_http_port = 80
vhost_https_port = 443
# console or real logFile path like ./frps.log
log_file = ./frps.log
# debug, info, warn, error
log_level = info
log_max_days = 3
# auth token
token = irrgpx8Y8FQJRJjT
# It is convenient to use subdomain configure for httphttps type when many people use one frps server together.
subdomain_host = *.*.*.*
# only allow frpc to bind ports you list, if you set nothing, there won't be any limit
#allow_ports = 1-65535
# pool_count in each proxy will change to max_pool_count if they exceed the maximum value
max_pool_count = 50
# if tcp stream multiplexing is used, default is true
tcp_mux = true

远程桌面

控制端 [frpc.ini]

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
[common]
server_addr = *.*.*.*
server_port = ****
token = ******

[p2p_mstsc_visitor]
#官方文档是使用xtcp,但是测试发现穿透率不高,所以改用stcp
type = stcp
# xtcp 的访问者
role = visitor
# 要访问的 xtcp 代理的名字
server_name = mstsc
# 只有 sk 一致的用户才能访问到此服务
sk = ******
# 绑定本地端口用于访问 ssh 服务
bind_addr = 127.0.0.1
bind_port = ****

被控端 [frpc.ini]

1
2
3
4
5
6
7
8
9
10
11
[common]
server_addr = *.*.*.*
server_port = ****
token = ******

[mstsc]
type = stcp
# 只有 sk 一致的用户才能访问到此服务
sk = ******
local_ip = 127.0.0.1
local_port = 3389