frp中文文档frp简单教程 - 图1

frp原理图

以ssh到内网服务器为实例

准备:

  • 公网ip的服务器(frps运行)(学生可以去阿里云或者腾讯云购买,很便宜)
  • 内网服务器(frpc运行)

记住一点就好,公网ip的服务器运行frps,内网运行frpc

frps配置:

  1. # frps.ini
  2. [common]
  3. bind_port = 8881
  4. # ./frps -c ./frps.ini

frpc配置:

  1. # frpc.ini
  2. [common]
  3. server_addr = x.x.x.x
  4. server_port = 8881
  5. [ssh]
  6. type = tcp
  7. local_ip = 127.0.0.1
  8. local_port = 22
  9. remote_port = 6000
  10. # ./frpc -c ./frpc.ini
  1. 通过 ssh 访问内网机器,假设用户名为 test:

ssh -oPort=6000 test@x.x.x.x