[root@frp-server ~]# wget https://github.com/fatedier/frp/releases/download/v0.39.1/frp_0.39.1_linux_amd64.tar.gz
[root@frp-server ~]# tar -zxvf frp_0.39.1_linux_amd64.tar.gz
[root@frp-server ~]# mkdir -p /etc/frp
[root@frp-server ~]# cp frp_0.39.1_linux_amd64/frps.ini /etc/frp/
[root@frp-server ~]# cp frp_0.39.1_linux_amd64/frps /usr/bin/
[root@frp-server ~]# cp frp_0.39.1_linux_amd64/systemd/frps.service /usr/lib/systemd/system/
[root@frp-server ~]# systemctl enable frps
# 配置:frp/frpc.ini
[root@frp-server ~]# cat >> /etc/frp/frps.ini << EOF
[common]
server_addr = 47.113.186.199
server_port = 7000
token = hello_world
dashboard_port = 7500
dashboard_user = admin
dashboard_pwd = admin
enable_prometheus = true
log_file = /var/log/frps.log
log_level = info
log_max_days = 3
# [ssh]
# type = tcp
# local_ip = 127.0.0.1
# local_port = 22
# remote_port = 6000
EOF
# 2. 启动frps
[root@frp-server ~]# systemctl start frps
# 3. 查看监听端口信息
[root@frp-server ~]# netstat -tlnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp6 0 0 :::7500 :::* LISTEN 1686/frps
tcp6 0 0 :::7000 :::* LISTEN 1686/frps
[root@nfs-server ~]# wget https://github.com/fatedier/frp/releases/download/v0.39.1/frp_0.39.1_linux_amd64.tar.gz
[root@nfs-server ~]# tar -zxvf frp_0.39.1_linux_amd64.tar.gz
[root@nfs-server ~]# mv frp_0.39.1_linux_amd64 frp
# 配置frp client
[root@nfs-server ~]# mkdir -p /etc/frp
[root@nfs-server ~]# cp frp/frpc.ini /etc/frp/
[root@nfs-server ~]# cp frp/frpc /usr/bin/
[root@nfs-server ~]# cp frp/systemd/frpc.service /usr/lib/systemd/system/
# 配置frp client
[root@nfs-server ~]# cat >> /etc/frp/frpc.ini << EOF
[common]
tls_enable = true
server_addr = 47.113.186.199
server_port = 7000
token = hello_world
[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 6000
EOF
# 启动frp
[root@nfs-server ~]# systemctl enable frpc
[root@nfs-server ~]# systemctl start frpc
# 或者手工启动
[root@nfs-server ~]# /usr/bin/frpc -c /etc/frp/frpc.ini
2022/02/19 15:06:56 [I] [service.go:327] [ea9143fa3c23855d] login to server success, get run id [ea9143fa3c23855d], server udp port [0]
2022/02/19 15:06:56 [I] [proxy_manager.go:144] [ea9143fa3c23855d] proxy added: [ssh]
2022/02/19 15:06:56 [I] [control.go:181] [ea9143fa3c23855d] [ssh] start proxy success
[root@frp-server ~]# netstat -tlnp |grep 6000
tcp6 0 0 :::6000 :::* LISTEN 1374/frps
lixin-macbook:Downloads lixin$ ssh -p 6000 app@47.113.186.199
The authenticity of host '[47.113.186.199]:6000 ([47.113.186.199]:6000)' can't be established.
ECDSA key fingerprint is SHA256:f9rzf8hJyeI/I46XaWAZw3Ga/RgaTLgtZOiY0w7+9iA.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '[47.113.186.199]:6000' (ECDSA) to the list of known hosts.
app@47.113.186.199's password:
Last login: Sat Feb 19 14:55:49 2022 from 172.30.51.218