cloudflared icon indicating copy to clipboard operation
cloudflared copied to clipboard

🐛 Cannot connect to SSH when using cloudflared on WSL

Open lauyuen opened this issue 3 years ago • 1 comments

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

  1. ✔️ Windows.
  2. ✔️ Ubuntu machine on the same network (but not in WSL).
  3. ✔️ Ubuntu machine on a different network. But doesn't work in
  4. ❌ Ubuntu in WSL

To Reproduce

  1. Install cloudflared on all machines.
  2. Set up tunnel to add ssh.host.com to point to localhost:22.
  3. 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

lauyuen avatar Oct 01 '22 21:10 lauyuen

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.

bittylicious avatar May 14 '24 13:05 bittylicious