客户端程序下载地址: GitHub官方仓库地址 。
参照一键安装:frp-onekey ( https://github.com/KuwiNet/frp-onekey )
截至本文完成时,frp 的最新版本为 v0.59.0 。首先,将 Release 中最新版的二进制包下载并复制到服务器上。
curl -LO https://raw.githubusercontent.com/KuwiNet/frp-onekey/master/frpc.sh && chmod +x frpc.sh && ./frpc.sh
-- 不可访问国外 (或自行找代理地址)
curl -LO https://gitee.com/kuwinet/frp-onekey/raw/master/frpc.sh && chmod +x frpc.sh && ./frpc.sh
wget https://github.com/fatedier/frp/releases/download/v0.59.0/frp_0.59.0_linux_amd64.tar.gz
tar xf frp_0.59.0_linux_amd64.tar.gz
cd frp_0.59.0_linux_amd64/
可以看到目录中有 frpc frps 两个可执行文件分别为 frpc 的客户端以及服务端,以及 frpc.toml frps.toml 等示例配置文件。我们按照官方默认的目录,将 frpc 和 frpc.toml 复制到 /usr/local/frpc 中。
sudo mkdir -p /usr/local/frpc
sudo cp frpc /usr/local/frpc
sudo cp frpc.toml /usr/local/frpc
修改 frpc、frpc.toml 文件限制。
chmod 755 /usr/local/frpc/frpc
chmod 755 /usr/local/frpc/frpc.toml
使用编辑器打开 /usr/local/frpc/frpc.toml 。将下列配置信息加入配置文件。
serverAddr = "us.afrp.net"
serverPort = 7000
auth.method = "token"
auth.token = "afrp.net"
user = "your_name"
[[proxies]]
name = "nas.http"
type = "http"
localIP = "192.168.100.8"
localPort = 5000
customDomains = ["nas.yourdomain.com"]
subdomain = "nas"
[[proxies]]
name = "nas.https"
type = "https"
localIP = "192.168.100.8"
localPort = 5001
customDomains = ["nas.yourdomain.com"]
subdomain = "nas"
[[proxies]]
name = "linux.ssh.tcp"
type = "tcp"
localIP = "192.168.100.21"
localPort = 22
remotePort = 10022
[[proxies]]
name = "windows11.rdp.tcp"
type = "tcp"
localIP = "192.168.100.10"
localPort = 3389
remotePort = 13389
[[proxies]]
name = "windows11.rdp.udp"
type = "udp"
localIP = "192.168.100.10"
localPort = 3389
remotePort = 13389
这时,如果您使用一键安装就可以通过以下命令运行 frpc 客户端了。
启动、查看状态、重启 frpc
sudo systemctl start frpc
sudo systemctl status frpc
sudo systemctl restart frpc
手动安装的需要配置;一键安装的可以忽略。
参照:frpc-onekey
wget -N https://raw.githubusercontent.com/KuwiNet/frpc/master/frpc.init
mv frpc.init /etc/init.d/frpc
chmod 755 /etc/init.d/frpc
update-rc.d -f frpc defaults
ln -s /etc/init.d/frpc /usr/bin/frpc
CentOS/Redhat
chkconfig --add frpc
sudo systemctl start frpc # 启动服务
sudo systemctl restart frpc # 重启服务
sudo systemctl status frpc # 查看状态
sudo ./frpc.sh update # 自动检测更新
sudo ./frpc.sh reinstall # 强制重新安装
sudo ./frpc.sh uninstall # 卸载
用法: frpc {start|stop|restart|status|config|version}
frpc start # 启动服务
frpc restart # 重启服务
frpc stop # 停止服务
frpc status # 查看状态
frpc version # 查看版本
frpc config # 修改配置
frpc status
如果未启动可用下面命令启动。
frpc start