如题

客户端

centos安装脚本

yum install -y wget
version=0.21.0
wget https://github.com/fatedier/frp/releases/download/v${version}/frp_${version}_linux_amd64.tar.gz -O frp_linux_amd64.tar.gz
tar zxf frp_linux_amd64.tar.gz
cd frp_${version}_linux_amd64
mv frpc /usr/local/bin/frpc
mkdir /etc/frp/
cp frpc.ini /etc/frp/


cat <<EOF > /etc/systemd/system/frpc.service
[Unit]
Description=frpc daemon
After=network.target

[Service]
Type=simple
ExecStart=/usr/local/bin/frpc -c /etc/frp/frpc.ini
ExecReload=/usr/local/bin/frpc -c /etc/frp/frpc.ini reload
Restart=always
RestartSec=5s

[Install]
WantedBy=multi-user.target
EOF

服务管理

systemctl enable frpc
systemctl restart frpc
systemctl status frpc

服务端

centos安装脚本

yum install -y wget
version=0.20.0
wget https://github.com/fatedier/frp/releases/download/v${version}/frp_${version}_linux_amd64.tar.gz -O frp_linux_amd64.tar.gz
tar zxf frp_linux_amd64.tar.gz
cd frp_${version}_linux_amd64
mv frps /usr/local/bin/frps
mkdir /etc/frp/
cp frps.ini /etc/frp/


cat <<EOF > /etc/systemd/system/frps.service
[Unit]
Description=frps daemon
After=network.target

[Service]
Type=simple
ExecStart=/usr/local/bin/frps -c /etc/frp/frps.ini
ExecReload=/usr/local/bin/frps -c /etc/frp/frps.ini reload
Restart=always
RestartSec=5s

[Install]
WantedBy=multi-user.target
EOF

服务管理

systemctl enable frps
systemctl restart frps
systemctl status frps

标签: none

添加新评论