【Cloudflare系列教程】利用Tunnel远程连接你的窗口

下载

如果你的系统是64位窗口,下载链接
当然,你也可以选择适合你的版本, 项目地址放下面了

配置被控端

将下载的文件重命名为cloudflared.exe并设置环境变量,然后继续

#绑定你的cf账号,生成的鉴权文件位于 C:\Users\%USERNAME%\.cloudflared
cloudflared tunnel login
#新建tunnel
cloudflared tunnel create your_tunnel_name_here
#尝试运行
cloudflared tunnel run your_tunnel_name_here
#配置DNS,可在控制台检查记录
cloudflared tunnel route dns <NAME> your.domain.here
#编辑你的yml后运行tunnel,yml示例往下划拉
cloudflared tunnel --config /path/to/your/config.yml run

config.yml示例

#隧道的 UUID, 为登录鉴权的json文件名
tunnel: xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx
#鉴权文件的绝对路径
credentials-file: C:\Users\%USERNAME%\.cloudflared\xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx.json

ingress:
  #你的域名
  - hostname:your.domain.here
    service: rdp://localhost:3389
  #默认错误404
  - service: http_status:404

配置控制端

同样下载、重命名、设置环境变量后继续

cloudflared access rdp --hostname yourdomain.here --url localhost:3000

快捷键Win+R 输入mstsc打开远程桌面,输入 localhost:3000 连接看看吧!

为了方便使用,请保持被控端常启,并守护cloudflared进程

免责声明:本文只介绍连接部分,为了访问安全,请自行进行相关设置后再连接

参考链接

15 个赞

相比于免费版的向日葵远程控制,有优势吗?

我想不到有啥优势 :thinking:

收藏一下

todesk 还有这毛病吗:face_with_raised_eyebrow:

1 个赞

收藏下

1 个赞

推荐方案:zerotier + rdp或者parsec。我平常是家里挂梯子,公司rdpApp家里的Chrome

这个能用手机端的RD Client控制吗?

cf这个恐怕不行 你得对齐颗粒度

我用 rustdesk, 好像可以直接打洞

细说todesk

@Reno

老哥貌似不行,都按照操作来的。但是一mstsc到localhost:3000就出现了内部错误。

cf.exe的控制台也报错:

PS D:\Users\Admin\Downloads> .\cf.exe access rdp --hostname rdp1.xxx.it --url localhost:3000
2024-05-28T06:41:24Z INF Start Websocket listener host=localhost:3000
2024-05-28T06:42:06Z ERR failed to connect to origin error="websocket: bad handshake" originURL=https://rdp1.xxx.it
2024-05-28T06:42:21Z ERR failed to connect to origin error="websocket: bad handshake" originURL=https://rdp1.xxx.it
2024-05-28T06:42:23Z ERR failed to connect to origin error="websocket: bad handshake" originURL=https://rdp1.xxx.it
2024-05-28T06:42:47Z ERR failed to connect to origin error="websocket: bad handshake" originURL=https://rdp1.xxx.it
2024-05-28T06:48:32Z ERR failed to connect to origin error="websocket: bad handshake" originURL=https://rdp1.xxx.it
2024-05-28T06:48:52Z ERR failed to connect to origin error="websocket: bad handshake" originURL=https://rdp1.xxx.it
2024-05-28T06:49:51Z ERR failed to connect to origin error="websocket: bad handshake" originURL=https://rdp1.xxx.it
2024-05-28T06:50:03Z ERR failed to connect to origin error="websocket: bad handshake" originURL=https://rdp1.xxx.it

贴上解决思路供后来者借鉴:

被控端说明:Win10+Administrator账户(无密码)

  1. Win + R 并输入 lusrmgr.msc,然后单击 确定
  2. 单击 用户,然后双击对应的用户帐户,再选择 隶属于 选项卡,点击 添加 再点击 立即查找,找到 Remote Desktop User 添加进去。
  3. 开始 > 运行 (win+R) > 输入secpol.msc,打开本地安全策略 本地策略 > 安全选项 > 使用空密码的本地账户只允许进行控制台登录 > 禁用

借鉴资料:

1 个赞