安装 systemd

apt install systemd

创建 frpc.service 文件

nano /etc/systemd/system/frpc.service

写入内容

[Unit]
Description = frp client
After = network.target syslog.target
Wants = network.target

[Service]
Type = simple
ExecStart = /root/frp/frpc -c /root/frp/frpc.toml

[Install]
WantedBy = multi-user.target

frpc.toml配置示例

serverAddr = "s.wzh.kim"
serverPort = 7000
auth.method = "token"
auth.token = "***"

[[proxies]]
name = "dsm-https"
type = "tcp"
localIP = "127.0.0.1"
localPort = 5001
remotePort = 5001

使用 systemd 命令管理 frpc 服务

设置frps开机启动

systemctl enable frpc

启动frpc

systemctl start frpc

停止frpc

systemctl stop frpc

重启frpc

systemctl restart frpc

查看frpc状态

systemctl status frpc

最后修改:2024 年 03 月 28 日
如果觉得我的文章对你有用,请随意赞赏