放弃向日葵,teamviewer等一切第三方中继服务器~家里宽带是公网ip可以用DDNS,没有则用内网穿透;
1.搭建frp内网穿透服务
(1)服务端(具有公网ip的云服务器) frps.ini:
[common]
#公网服务端与内网客户端通讯的端口
bind_port = 7011
authentication_method = token
token = xxxx
启动命令:nohup ./frps -c ./frps.ini &
(2)客户端(自己家里电脑)
frpc.ini
[common]
#服务端ip
server_addr = xx.xx.xx.xx
server_port = 7011
token = xxx
[ssh]
type = tcp
local_ip = 127.0.0.1
#本地需要访问的映射端口(windows默认远程端口)
local_port = 3389
#远程转发到服务端的端口,rd软件访问的端口
remote_port = 7001
创建脚本,然后添加到C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup文件夹自启动;
frpc.vbs
set ws=WScript.CreateObject("WScript.Shell")
ws.Run "D:\soft\frp_0.41.0_windows_386\frp_0.41.0_windows_386\frpc.exe -c D:\soft\frp_0.41.0_windows_386\frp_0.41.0_windows_386\frpc.ini",0
2.设置RD Client
(1)电脑名称设置为:云服务器的公网ip + 内网电脑的远程访问端口,即:
xxx.xx.xx.xx + 7001;相当于软件访问 公网ip+7001=内网ip+3389;
(2)我这里遇到了用户无效,于是把账户从网络用户转为本地用户后可用;其他问题可百度;
本文由 GY 创作,采用 知识共享署名4.0 国际许可协议进行许可
本站文章除注明转载/出处外,均为本站原创或翻译,转载前请务必署名
最后编辑时间为:
2022/04/19 12:01