访问https://github.com/fatedier/frp/releases
下载系统对应版本
或者wget https://github.com/fatedier/frp/releases/download/v0.44.0/frp_0.44.0_linux_amd64.tar.gz
解压到自己目录,我这里解压到/usr/local/frp
tar -zxvf ...
修改frpc.ini
- [common]
- server_addr = ip
- server_port = 7000
- token = xxx
-
- [szyy_ssh]
- type = stcp
- local_ip = 127.0.0.1
- local_port = 22
- sk = xx
vim /usr/lib/systemd/system/frp.service
填写如下内容
- [Unit]
- Description=Frp Client Service
- After=network.target
-
- [Service]
- Type=simple
- User=nobody
- Restart=on-failure
- RestartSec=5s
- ExecStart=/usr/local/frp_0.44.0_linux_amd64/frpc -c /usr/local/frp_0.44.0_linux_amd64/frpc.ini
- ExecReload=/usr/local/frp_0.44.0_linux_amd64/frpc reload -c /usr/local/frp_0.44.0_linux_amd64//frpc.ini
-
- [Install]
- WantedBy=multi-user.target
systemctl daemon-reload systemctl enable frp
systemctl start frp
ps aux | grep frp
如果要重启应用,可以这样,systemctl restart frp
如果要停止应用,可以输入,systemctl stop frp
如果要查看应用的日志,可以输入,systemctl status frp