安装 systemd
apt install systemd
创建 frps.service 文件
cat > /etc/systemd/system/frps.service << EOF
[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
EOF
frps.toml配置示例
bindPort = 7000
auth.method = "token"
auth.token = "***"
#vhostHTTPPort = 7080
#vhostHTTPSPort = 7443
设置frpc开机自启并启动
systemctl enable frps
systemctl start frps