利用frp实现内网穿透,外网远程桌面内网windows电脑

    科技2022-07-11  102

    一、下载frp

    找到最新版本下载即可

    win端直接解压即可,服务器端使用的是centos7

    二.服务器端安装

    1.下载

    wget https://github.com/fatedier/frp/releases/download/v0.34.0/frp_0.34.0_linux_amd64.tar.gz

    tar指令解压

    tar -zxvf frp_0.34.0_linux_amd64.tar.gz

    cd进入解压后文件夹

    cd frp_0.34.0_linux_amd64

    2.修改服务端frps.ini配置文件

    [common] #监听地址 bind_addr = 0.0.0.0 #服务端口 bind_port = 7000 #认证token token = xxxx #面板界面 dashboard_addr = 0.0.0.0 dashboard_port = 7500 dashboard_user = xxx dashboard_pwd = xxx #http服务端口 vhost_http_port = 7080 #https服务端口 vhost_https_port = 7443 #日志 log_file = ./frps.log log_level = info log_max_days = 3

    3.运行(注意目前还是在frp解压目录中进行)

    ./frps -c frps.ini

    二、win客户端安装

    1.解压后,修改frpc.ini

    [common] # frps的ip地址 server_addr = IP # frps的端口 server_port = 7000 # 认证token token = xxx # 日志 log_file = ./frpc.log log_level = info log_max_days = 3 [ssh] type = tcp local_ip = 127.0.0.1 local_port = 22 remote_port = 58889 [web] type = http local_ip = 127.0.0.1 local_port = 8080 remote_port = 10005 use_encryption = trues use_gzip = true custom_domains = 没有域名写IP [RDP] type = tcp local_ip = 127.0.0.1 local_port = 3389 remote_port = 58888 use_encryption = true

    2.运行

    frpc -c frpc.ini

    注意日志写进文件了,去解压目录查看

    问题

    1.SSH需要win端安装ssh,我用的是openssh

    2.远程桌面需要在win系统中开启,记得好像win10需要专业版才可以开启,如果遇到用户密码正确却无法验证可以在系统中改一下验证方式(具体细节可百度)

    3.服务器需要开放所用的端口

    4.win端启动脚本

    保存至frp目录下,frp.vbs

    wscript.sleep 1000*20 set ws = CreateObject("Wscript.Shell") ws.Run("%comspec% /k frpc.exe -c frpc.ini")

    5.http没有测试

    Processed: 0.030, SQL: 8