vim /lib/systemd/system/frpc.service 或者 vi /lib/systemd/system/frpc.service
[Unit] Description=Frp Client Service After=network.target [Service] Type=simple User=nobody Restart=on-failure RestartSec=5s ExecStart=/root/frp/frpc -c /root/frp/frpc.ini ExecReload=/root/frp/frpc reload -c /root/frp/frpc/frpc.ini [Install] WantedBy=multi-user.target
!!!此处直接运行systemctl命令会提示需要重载!!! 于是终端里输入 systemctl daemon-reload 使用systemctl命令来控制frpc #启动 sudo systemctl start frpc #关闭 sudo systemctl stop frpc #重启 sudo systemctl restart frpc #查看状态 sudo systemctl status frpc 设置开机自动启动 sudo systemctl enable frpc linux下FRP常用命令 后台运行frp
#定位至frp文件所在位置
服务端: nohup ./frps -c frps.ini >/dev/null 2>&1 &
客户端: nohup ./frpc -c frpc.ini >/dev/null 2>&1 &
查看frp进程
ps -aux|grep frp| grep -v grep
结束frp进程
kill -9 12345(找到的进程号)