一、下載安裝對應系統版本nginx
https://github.com/fatedier/frp/releases/
二、將下載的frp移動到系統軟件目錄git
mv frp/ /usr/local
三、配置frpgithub
vim /etc/systemd/system/frps.service
[Unit] Description=frps Daemon After=syslog.target network.target Wants=network.target [Service] Type=simple ExecStart=/usr/local/frp/frps -c /etc/frps.ini Restart=always RestartSec=1min ExecStop=/usr/bin/killall frps [Install] WantedBy=multi-user.target
配置/etc/frps.ini:vim
[common] bind_addr = 0.0.0.0 bind_port = 7000
systemctl enable frps.service
systemctl start frps.service
配置/etc/frpc.ini,轉發ssh到公網6000端口:ssh
[common] server_addr = x.x.x.x server_port = 7000 [ssh] type = tcp local_ip = 127.0.0.1 local_port = 22 remote_port = 2222
./frpc -c frpc.ini