zoukankan      html  css  js  c++  java
  • 利用frp做内网穿透实现远程桌面


      TeamViewer要付费,向日葵高峰期慢的要死,AnyDesk、GoDesk又慢又不稳定,总之不付费白嫖是不可能爽的。刚好有台闲置的2M服务器,配合使用frp做内网穿透,实现3389远程连接内网机器。
    https://github.com/fatedier/frp

    场景

    1,一台具有固定公网IP的机器[server],linux/windows都行
    2,一台Win10常用机[client],公网IP不固定

    期望

    能通过mstsc远程连接client

    实现

    1.部署服务端frps

    server机器通过docker安装更简单,https://hub.docker.com/r/snowdreamtech/frps

    docker run --restart=always --network host -d -v /etc/frp/frps.ini:/etc/frp/frps.ini --name frps snowdreamtech/frps
    

    2.配置frps.ini

    完整文档:https://gofrp.org/docs/
    以下用到的7000,7500,7001端口可自行定义且需开放。

    [common]
    bind_port = 7000  #服务端监听端口,接收frpc的连接
    token = tT52****n9Q8 #用于鉴权,客户端(frpc)需要设置一样的值才能鉴权通过
    
    #Dashboard, 监控面板
    dashboard_port = 7500
    dashboard_user = admin
    dashboard_pwd = ******
    

    配好之后需要重新加载或者直接restart容器,然后通过http://server公网IP:dashboard_port 可以访问监控面板。



    3.部署客户端frpc

    通过Github的Release页面下载windows版本的压缩包,客户端只需要用到frpc.exe和frpc.ini两个文件(会被windows防火墙当成病毒杀掉)

    4.配置frpc.ini

    [common]
    server_addr = xx.xxx.xx.x  #server的公网IP 
    server_port = 7000 #服务端的监听端口
    token = tT52****n9Q8 #和服务端对应
    
    [rdp-mf]
    local_port=3389 #本地端口,远程桌面默认3389
    remote_port=7001 #对外开放的端口,使用服务器IP:remote_port连接到内网机器
    

    5.启动frpc

    打开cmd,切到frpc.exe所在目录 执行frpc.exe -c frpc.ini

    C:Usersadmin>d:
    D:>cd D:Program Files (x86)frp_0.34.2_windows_amd64
    D:Program Files (x86)frp_0.34.2_windows_amd64>frpc.exe -c frpc.ini
    

    配置完成,在另一台通过server公网IP:7001即可远程client

  • 相关阅读:
    【Winform】Webservice调用服务器端EXE
    LeetCode: Word Ladder II
    LeetCode: Maximal Rectangle
    Algorithm: 拓扑排序
    Algorithm: 匈牙利算法
    LeetCode: Scramble String
    LeetCode: Integer to Roman
    LeetCode: Roman to Integer
    算法导论:基础知识。
    C++主函数main()讲解
  • 原文地址:https://www.cnblogs.com/wu_u/p/14012283.html
Copyright © 2011-2022 走看看