-
Notifications
You must be signed in to change notification settings - Fork 821
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 to remote causes disconnect with client_loop: send disconnect: Broken pipe #7966
Comments
read answer here: 616355 for per-user configuration, Edit the file
this could be also set globally in ServerAliveInterval: number of seconds that the client will wait before sending a null packet to the server (to keep the connection alive). |
I already had the following in
I just added |
Looks promising, thanks! I'll do a few more tests and confirm that the error is gone. |
Unfortunately, the issue is not resolved. SSH aside, if I run side-by-side pings from Windows and WSL to a remote host, I see up to 20% packet loss on the WSL network, but 0% on Windows. |
You can try in debug mode with command |
ssh client:
I manage clusters of servers on multiple continents and I hit the same issue no matter what server I ping or ssh. I honestly fail to see how this is an ssh issue, more likely an issue with TCP NAT again: #6416 (comment) |
Hi there. My log with verbose:
|
@equation-group can you explain why this would make a difference? We don't permit root logins on any of our servers in any event. I'm seeing disconnects on almost any utility or script that uses the network so this is clearly not an ssh issue. |
I was having the same problem setting up an sftp user. Every connection by sftp was immediately disconnected I discovered this message in the /var/log/message The sshd_config directory specified that "/srv/sftp/data/ftpuser" in the ChrootDirectory. The ftpuser directory was owned by ftpuser. Now sftp connections are working. |
@rochecompaan @RandolphBack The fix is change MTU to 1350 using cmd and then do this: #4901 (comment) |
@equation-group changing MTU or DNS settings does not work for me. I saw this comment explaining how to change "Auto metric" on the TCP/IP settings for the adapter to "1" and that seems to work! I will log ping stats for a few days to confirm. |
I have been running a ping script for several hours now, and I do not see any packet loss, so this is resolved for me. I just noticed that I have 2 WiFi adapters, which was probably causing the issue. After reading up on automatic metric feature , I guess setting the interface metric to 1 on one of the adapters forces all the network traffic through that adapter. I don't know enough, but with auto metric enabled, traffic might not always go through the correct bridge interface on WSL. |
@equation-group
What's wrong here? I can enter |
@svdHero there was a typo in the command, i corrected it. |
what helped a little in my case (
The following did not help, but currently in place: # echo 1 | sudo tee /proc/sys/net/ipv4/tcp_mtu_probing # did not help, commented out
sudo ifconfig eth0 mtu 1350 in Windows: netsh interface ipv4 set subinterface "vEthernet (WSL)" mtu=1350 store=persistent I have not changed the interface metric settings, as I use an Ethernet adapter on my working station. This is definitely a WSL2 issue, since the same I don't understand, why the ticket has been closed. |
Using a proxy might help |
This is issue only started for me after enabling stricter cryptographic settings on the server. Connecting over the WireGuard tunnel went fine, straight via PowerShell too. Connecting to the servers' public IP didn't. Changing the MTU did resolve the issue. I don't use a local ssh config for the client. FWIW, it was coupled with a "sshd[1186]: fatal: mm_answer_sign: sign: error in libcrypto" on the server side. |
finally figured out: group policy update forces restart of WSL network interface: https://learn.microsoft.com/en-us/answers/questions/723272/group-policy-update-and-hyper-v-vethernet-disconne.html |
Can confirm this, running "gpupdate /force" always leads to a ssh disconnect. |
Just a note: it's nothing to do with WSL. I can repro this on a Linux (gentoo) system with an ssh into localhost. Clearly that is a bug, but my best guess is that it is caused by having a local system that is IPv6; if the IPv6 connection drops the local IPv6's change and I suspect that reveals a bug in ssh. |
Version
Microsoft Windows [Version 10.0.22000.434]
WSL Version
Kernel Version
5.10.60.1
Distro Version
Ubuntu 20.04
Other Software
No response
Repro Steps
ssh to any remote machine from Ubuntu 20.04 under WSL. ssh from Powershell works without issues.
Expected Behavior
ssh connection should persist and stay connected
Actual Behavior
Consistent disconnects after a few seconds:
Diagnostic Logs
networking.bat.log
wsl.etl.zip
The text was updated successfully, but these errors were encountered: