Can't get Cloudflare Tunnel RDC working

I have a Linux machine (linuxMint 21, Ubuntu 22.04) and a Windows 10 machine.
I connect to the Linux machine via RDP.
Now I want to use Cloudflare Tunnels to connect from the outside.
I can connect HTTP and SSH/Web but RDP cannot find the machine.
I have Cloudflared working on both machines.
I added an application for HTTP, SSH and RDP.
I added hostnames for all three
ingress:

  • hostname: rdp domain net
    service: rdp: // 127.0.0.1:3389
  • hostname: web domain net
    service: http: // localhost:80
  • hostname: ssh domain net
    service: ssh: // localhost:22
    I authenticated via IP on all three applications.
    HTTP works great.
    SSH using web works but not with a client, I had to turn on “Browser rendering”.
    RDP fails with the Windows RDP Client not finding the server.
    I also tried adding ““C:\Program Files (x86)\cloudflared\cloudflared.exe” access rdp --hostname rdp domain net --url localhost :3389"” to be run before trying to connect. The instructions said to have RDP Client connect to localhost but it does not allow, stating that the computer cannot be connected to because it is already in use.

Any help???

You cannot make cloudflared listen on localhost port 3389 to proxy RDP, since that port is claimed by your local Remote Desktop Service. Please pick a different port and connect to that localhost port after proxying.

I realise after looking that the docs say you should use 3389, unfortunately the docs are wrong, please try a different local port for that command.

For SSH, you need to setup your SSH config locally to access tunneled SSH servers. Run cloudflared access ssh-config for relevant instructions.

1 Like

Did you follow this step?

There’s alternative way. Just connect the private network in which the RDP is running to Cloudflare. Than using just the private ip you can connect. You setup network policy and enforcement also

“C:\Program Files (x86)\cloudflared\cloudflared.exe” access rdp --hostname rdp domain net --url localhost :3399"
and RDC Client Computer: localhost:3399

I get: 2022-08-13T03:59:08Z ERR failed to connect to origin error=“websocket: bad handshake” originURL=https // rdp domain net

If I type cloudflared access rdp -h (in cmd on Windows) I get help on:
NAME:
cloudflared access tcp -

Thanks for the quick reply and help.

For SSH from the windows machine I use putty.
Instructions say to:
Add to your /.ssh/config:

Host [your hostname]
ProxyCommand cloudflared access ssh --hostname %h

With putty there is no ssh config, it’s all done in the GUI and I don’t see anywhere to add a command to run cloudflared.

For now I will just occasionally use SSH so the WEB version might be OK, but I am trying to learn all this, I think all this can be useful once I understand all the fine details.

Possible solution for SSH:

When running putty on a windows machine I did the following and it (maybe) works.

Under Connections → Proxy
Proxy Type: Local
Proxy Hostname: localhost

Telnet command or local proxy command:
“C:\Program Files (x86)\cloudflared\cloudflared.exe” access rdp --hostname ssh domain net

It connects up. Not sure how to determine is it is running thru the tunnel. I guess it is because the machine is behind NAT and I am connecting.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.