afrp.net

AFRP OIDC 认证中心 · 使用文档

Linux 安装 frpc 客户端

一、下载并安装 frpc 客户端

客户端程序下载地址: GitHub官方仓库地址
参照一键安装:frp-onekey ( https://github.com/KuwiNet/frp-onekey )
截至本文完成时,frp 的最新版本为 v0.59.0 。首先,将 Release 中最新版的二进制包下载并复制到服务器上。


二、配置 frpc.tmol

使用编辑器打开 /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 客户端管理脚本(一键安装忽略)

手动安装的需要配置;一键安装的可以忽略。
参照:frpc-onekey

  1. 下载 frpc.init 移动到 /etc/init.d/frpc 并赋权
    wget -N https://raw.githubusercontent.com/KuwiNet/frpc/master/frpc.init
    mv frpc.init /etc/init.d/frpc
    chmod 755 /etc/init.d/frpc
  2. 安装快捷命令
    Debian/Ubuntu
    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    # 修改配置

到此为止,frp服务端的安装就算完成了。可以使用下面的命令测试一下安装是否成功。

frpc status

如果未启动可用下面命令启动。

frpc start