frp设置开机自启服务

  • A+
所属分类:linux技术
摘要

服务端客户端

服务端

$ sudo vi /lib/systemd/system/frps.service --------------------------------  $ cat frps.service [Unit] Description=frps server service After=network.target  [Service] Type=simple User=root Restart=on-failure RestartSec=5s ExecStart=/frp/frps -c /frp/frps.ini  [Install] WantedBy=multi-user.target --------------------------------  $ sudo systemctl daemon-reload $ sudo systemctl enable frps 

客户端

$ sudo vi /lib/systemd/system/frpc.service --------------------------------  $ cat frpc.service  [Unit] Description=frp client service  After=network.target   [Service]  Type=simple User=root  Restart=on-failure RestartSec=5s  ExecStart=/frp/frpc -c /frp/frpc.ini  ExecReload=/frp/frpc reload -c /frp/frpc.ini   [Install] WantedBy=multi-user.target --------------------------------  $ sudo systemctl daemon-reload $ sudo systemctl enable frpc