以 centos7 为例
vim /usr/lib/systemd/system/frps.service #
内容如下
[Unit] Description=frps After=network.target [Service] TimeoutStartSec=30 ExecStart=/usr/local/bin/frps -c /etc/frp/frps.ini ExecStop=/bin/kill $MAINPID [Install] WantedBy=multi-user.target
# 启动 frp 并设置开机启动
systemctl enable frps
systemctl start frps
systemctl status frps