[Solved]Cloudflare tunnel ssh didn't work in wsl

I set up a tunnel to access the ssh service of my server today. When I tried to connet to the tunnel in Windows(cmd) and browser-rendered terminal, the tunnel worked well. However, when I tried to connect to it in WSL2(ubuntu), nothing happened after I authorized the access in the url given.

The command I used:

image

Nothing happened after this.I tried to type something and press enter, nothing happened either.

The ssh .config is set to:

Host ssh-shs.caomingjun.com
        ProxyCommand cloudflared access ssh --hostname %h

I tried to run cloudflared access ssh --hostname ssh-shs.caomingjun.com , it outputs :

SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.4

Nothing happened after this. If I type something and press enter, it returns Invalid SSH identification string.

By the way, I reinstalled the openssh-server in WSL2(ubuntu) when I installed WSL2(ubuntu). (But I don’t think it has anything to do with the problem)

Sorry guys!

I tried it on my kubuntu computer and found that I mistakenly had ~/.ssh/.config as config file, not ~/.ssh/config.

1 Like

ok then feel free to mark any reply of this as solution so others can find what they are looking for easily.

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