Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ssh hangs #8985

Closed
1 of 2 tasks
kovan opened this issue Oct 10, 2022 · 13 comments
Closed
1 of 2 tasks

ssh hangs #8985

kovan opened this issue Oct 10, 2022 · 13 comments

Comments

@kovan
Copy link

kovan commented Oct 10, 2022

Version

Microsoft Windows [Version 10.0.22610.1]

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

5.15.57.1

Distro Version

Ubuntu 22.04

Other Software

➜ ~ ssh -V
OpenSSH_8.9p1 Ubuntu-3, OpenSSL 3.0.2 15 Mar 2022

Repro Steps

➜  ~ ssh -vvv [email protected]
OpenSSH_8.9p1 Ubuntu-3, OpenSSL 3.0.2 15 Mar 2022
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/home/k/.ssh/known_hosts'
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/home/k/.ssh/known_hosts2'
debug2: resolving "github.com" port 22
debug3: resolve_host: lookup github.com:22
debug3: ssh_connect_direct: entering
debug1: Connecting to github.com [140.82.121.3] port 22.
debug3: set_sock_tos: set socket 3 IP_TOS 0x10

Trying to clone via SSH has same behavior:

➜  ~ git clone [email protected]:enaqx/awesome-react
Cloning into 'awesome-react'...

And stays there indefinitely.

Expected Behavior

SSH session should start.

Actual Behavior

The connection attempt stays there indefinitely.

Diagnostic Logs

netcat connects fine to the SSH port:

➜  ~ nc github.com 22
SSH-2.0-babeld-3f0fc83a
^C

And (IMPORTANT) on Windows the same commands work well.
And also important, all this is in a just resetted Windows, and a just installed Ubuntu.

@brainandforce
Copy link

brainandforce commented Oct 10, 2022

I'm able to reproduce this here on Windows 11 22H2 [Version 10.0.22621.608] with an Arch Linux distribution running kernel 5.15.68.1-microsoft-standard-WSL2.

@kovan kovan closed this as completed Oct 12, 2022
@brainandforce
Copy link

Were you able to find a solution for this issue?

@kovan
Copy link
Author

kovan commented Oct 12, 2022

I installed Debian and there it didn't happen.
I am going to leave this open because it is not clear what is causing this.

@edupo
Copy link

edupo commented Nov 11, 2022

I have the same issue. I can't use SSH but also HTTPS isn't working in WSL2. My fix is just using WSL1 at this moment.

@brainandforce
Copy link

I found a potential fix suggested in #8018 in this comment. I just tried it myself and I'll report back to see if this solves it.

@kovan
Copy link
Author

kovan commented Nov 24, 2022

Happening again here, this time with a different distribution: ArchLinux.
I tried the potential fix mentioned above, and didn't work for me.

@brainandforce
Copy link

I think I've found the workaround. If you're getting stuck at a set_sock_tos: operation (use ssh -v to check) and you're on a wireless connection, it might be due to how router QoS handles SSH packets. I was able to connect to servers by using ssh -o IPQoS=none <hostname>. This can be set permanently by adding the line IPQoS none in ~/.ssh/config.

Sources:
https://askubuntu.com/questions/1415021/cannot-ssh-to-server-linux-machine/1418608#1418608
https://serverfault.com/questions/1101269/cant-connect-ssh-via-wireless-interface-but-t-works-using-eth0

@Blaucel
Copy link

Blaucel commented Feb 1, 2023

I think I've found the workaround. If you're getting stuck at a set_sock_tos: operation (use ssh -v to check) and you're on a wireless connection, it might be due to how router QoS handles SSH packets. I was able to connect to servers by using ssh -o IPQoS=none <hostname>. This can be set permanently by adding the line IPQoS none in ~/.ssh/config.

Sources: https://askubuntu.com/questions/1415021/cannot-ssh-to-server-linux-machine/1418608#1418608 https://serverfault.com/questions/1101269/cant-connect-ssh-via-wireless-interface-but-t-works-using-eth0

I've been stuck for 3 days with this issue. You basically saved my mental health XD
Thanks!!!

@CoryKniefel
Copy link

I think I've found the workaround. If you're getting stuck at a set_sock_tos: operation (use ssh -v to check) and you're on a wireless connection, it might be due to how router QoS handles SSH packets. I was able to connect to servers by using ssh -o IPQoS=none <hostname>. This can be set permanently by adding the line IPQoS none in ~/.ssh/config.

Sources: https://askubuntu.com/questions/1415021/cannot-ssh-to-server-linux-machine/1418608#1418608 https://serverfault.com/questions/1101269/cant-connect-ssh-via-wireless-interface-but-t-works-using-eth0

This saved me. THANK YOU!!!

@dufferzz
Copy link

dufferzz commented Sep 1, 2023

I think I've found the workaround. If you're getting stuck at a set_sock_tos: operation (use ssh -v to check) and you're on a wireless connection, it might be due to how router QoS handles SSH packets. I was able to connect to servers by using ssh -o IPQoS=none <hostname>. This can be set permanently by adding the line IPQoS none in ~/.ssh/config.

Sources: https://askubuntu.com/questions/1415021/cannot-ssh-to-server-linux-machine/1418608#1418608 https://serverfault.com/questions/1101269/cant-connect-ssh-via-wireless-interface-but-t-works-using-eth0

Thank you! Git will now pull properly again, and Openssh SSH client works!
Previously OpenSSH client would hang but Putty SSH and telnet localhost 22 worked!

Copy link
Contributor

This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request.

Thank you!

@alchemizt
Copy link

Im having this problem, I tried adding IPQoS=none <hostname> and it changed something, now it says connecting direct to IP, but its still hanging.

@Roby5791
Copy link

Have you find a solution alchemizt ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants