一、下载frp0.34.3软件
# 下载frp软件
[root@localhost frp_0.34.3]# wget https://github.com/fatedier/frp/releases/download/v0.34.3/frp_0.34.3_linux_amd64.tar.gz
# 解压frp软件
[root@localhost frp_0.34.3]# tar -zxvf frp_0.34.3_linux_amd64.tar.gz
# 将软件移至opt目录
[root@localhost frp_0.34.3]# mv frp_0.34.3_linux_amd64 /opt/frp_0.34.3
# 修改服务端frps.ini文件,token为客户端连接密码
[root@localhost frp_0.34.3]# vi /opt/frp_0.34.3/frps.ini
[common]
bind_port = 7000
vhost_http_port = 80
token = Abc123
# 启动frp服务端
[root@localhost frp_0.34.3]# nohup /opt/frp_0.34.3/frps -c /opt/frp_0.34.3/frps.ini
# 配置服务端管理
[root@localhost frp_0.34.3]# vi /etc/systemd/system/frps.service
[Unit]
Description=frps service
After=network.target
[Service]
Type=simple
ExecStart=/opt/frp_0.34.3/frps -c /opt/frp_0.34.3/frps.ini
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
# 刷新服务配置文件
[root@localhost frp_0.34.3]# sudo systemctl daemon-reload
# 启动frps服务端
[root@localhost frp_0.34.3]# sudo systemctl start frps
# 查询frps启动状态
[root@localhost frp_0.34.3]# sudo systemctl status frps
# 设置frps开机启动
[root@localhost frp_0.34.3]# sudo systemctl enable frps