穿墙神器frp的安装与配置
2023-06-13 09:16:16 时间
如题
客户端
centos安装脚本
version=`curl --silent "https://api.github.com/repos/fatedier/frp/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")'`
v=`echo $version|grep -Po 'v\K(.*)'`
curl -sSL https://github.com/fatedier/frp/releases/download/$version/frp_"$v"_linux_amd64.tar.gz|tar zx -C /tmp/ -x frp_"$v"_linux_amd64/frpc frp_"$v"_linux_amd64/frpc.ini --strip-components 1
mv /tmp/frpc /usr/local/bin/frpc
mkdir /etc/frp/
mv /tmp/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安装脚本
version=`curl --silent "https://api.github.com/repos/fatedier/frp/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")'`
v=`echo $version|grep -Po 'v\K(.*)'`
curl -sSL https://github.com/fatedier/frp/releases/download/$version/frp_"$v"_linux_amd64.tar.gz|tar zx -C /tmp/ -x frp_"$v"_linux_amd64/frps frp_"$v"_linux_amd64/frps.ini --strip-components 1
mv /tmp/frps /usr/local/bin/frps
mkdir /etc/frp/
mv /tmp/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
相关文章
- weka怎么安装_we是什么安装方式
- TomCat安装和配置
- 运维之LAMP环境安装与配置
- 【R环境配置】在R3.6.2版本上安装转录组分析相关R包
- Maven简介和安装(配置中央仓库和本地仓库,IDEA配置Maven)
- centOS安装nginx及相关配置
- 交互式原型设计Axure软件中文激活版,Axure软件2023安装教程下载
- kubernetes集群交付安装spinnaker自动化部署
- 一步步教你Centos系统安装Postgresql 配置及环境变量配置详细步骤
- 教你如何在mac系统下安装与配置mongoDB数据库的详细步骤
- Ubuntu 14.04安装配置NFS服务器详解程序员
- 在 CentOS 8/RHEL 8 上安装和使用 Cockpit的方法
- PHP在Linux系统中的安装与下载(php下载linux)
- GCC在Linux上的安装与配置(linuxgcc下载)
- 安装Linux系统用RPM包进行配置(linux安装rpm包)
- Linux系统上安装LZMA压缩工具(linux安装lzma)
- Linux下NS2安装及配置指南(linux安装ns2)
- 安装禅道Linux教程(禅道安装linux)
- StepbyStep Guide: Installing and Configuring SVN on Linux(linux安装配置svn)
- 教你轻松完成Linux MSI安装:从下载到配置全步骤(linuxmsi安装)
- 一步一步编译安装Redis4(编译安装redis4)
- 易语言搭建Redis一键安装,快速便捷(易语言一键安装redis)
- Ubuntu中Nginx的安装与配置详细说明
- Node调试工具JSHint的安装及配置教程