原文:点这里
1.服务端安装
a.脚本frps-install.sh
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
#授权 chmod u+x ./frps-install.sh
b.frps服务管理
systemctl enable frps
systemctl restart frps
systemctl status frps
2.客户端安装
a.脚本frpc-install.sh
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 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
#授权 chmod u+x ./frpc-install.sh
b.frpc服务管理
systemctl enable frpc
systemctl restart frpc
systemctl status frpc
3.frp Windows服务安装
3.1 下载https://github.com/winsw/winsw/releases
3.2 (演示frpc客户端服务)将下载后的文件重命名为frpc-service.exe,并创建文件frpc-service.xml文件,目录可自己修改
<service>
<!-- ID of the service. It should be unique across the Windows system-->
<id>frpc</id>
<!-- Display name of the service -->
<name>frp client</name>
<!-- Service description -->
<description>Service for frp client</description>
<!-- frp install dir -->
<workingdirectory>C:\frp</workingdirectory>
<!-- frpc.exe -->
<executable>C:\frp\frpc.exe</executable>
<!-- args -->
<startarguments>-c frpc.ini</startarguments>
</service>
3.3 将上述两个文件copy到frp所在的目录,然后打开cmd,进入该目录,执行:
.\frpc-service.exe install
3.4 启动frpc客户端命令:
net start frpc
版权属于:sunjianhua
本文链接:https://sunjianhua.cn/archives/frp-all-in-one.html
转载时须注明出处及本声明,如果不小心侵犯了您的权益,请联系邮箱:NTA2MTkzNjQ1QHFxLmNvbQ==
腻害腻害