SSH through cloudflare tunnel with cloudflared on client not working

I followed the documentation on these two pages:
https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/get-started/create-local-tunnel/ to create a tunnel
https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/use-cases/ssh/ to configure my client

The tunnel is running on an ubuntu VM in my home server, and the client is my mac.

I can see the tunnel on Zero Trust dashboard > Networks > Tunnels, and it’s indicated that the connection is “Healthy”

I can see the CNAME record on my DNS, with the UUID of my tunnel.

SSH to the server by local IP works.

I have tried using the same SSH key pair that I use to connect locally, and no SSH key pair - neither works.

I get this error when running ssh [email protected]:

kex_exchange_identification: Connection closed by remote host
Connection closed by UNKNOWN port 65535

The second article I linked mentions, " When the command is run, cloudflared will launch a browser window to prompt you to authenticate with your identity provider before establishing the connection from your terminal." No such browser window opens.

Can someone please suggest some next steps to troubleshoot the connection?

I found the issue. I had SSL/TLS disabled in cloudflare for my domain. Setting it to flexible made SSH work. Woo!

1 Like

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