安装 systemd
apt install systemd
创建 frps.service 文件
nano /etc/systemd/system/frps.service
写入内容
[Unit]
Description = frp server
After = network.target syslog.target
Wants = network.target
[Service]
Type = simple
ExecStart = /root/frp/frps -c /root/frp/frps.toml
[Install]
WantedBy = multi-user.target
frps.toml配置示例
bindPort = 7000
auth.method = "token"
auth.token = "***"
#vhostHTTPPort = 80
#vhostHTTPSPort = 443
使用 systemd 命令管理 frps 服务
设置frps开机启动
systemctl enable frps
启动frps
systemctl start frps
停止frps
systemctl stop frps
重启frps
systemctl restart frps
查看frps状态
systemctl status frps