cloudflared
cloudflared copied to clipboard
🐛 Cannot connect to SSH when using cloudflared on WSL
Describe the bug When using cloudflared, ssh errors with
debug1: SSH2_MSG_KEXINIT sent
Bad packet length 1231976033.
ssh_dispatch_run_fatal: Connection to UNKNOWN port 65535: message authentication code incorrect
The exact same configuration works in
- ✔️ Windows.
- ✔️ Ubuntu machine on the same network (but not in WSL).
- ✔️ Ubuntu machine on a different network. But doesn't work in
- ❌ Ubuntu in WSL
To Reproduce
- Install cloudflared on all machines.
- Set up tunnel to add ssh.host.com to point to localhost:22.
- Add
Host ssh.host.com
Hostname ssh.host.com
User git
ProxyCommand /usr/local/bin/cloudflared access ssh --hostname %h
to ~/.ssh/config
5. Sign in with ssh [email protected]
6. Click OK in browser
7. Error.
Expected behavior A clear and concise description of what you expected to happen.
Environment and versions
Linux HOST 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
In case anyone comes across this, I had the same issue and upgrading the cloudflared binary on the client, i.e. the machine performing the SSH connection, fixed things.