WSL: SSH to remote causes disconnect with client_loop: send disconnect: Broken pipe
Version
Microsoft Windows [Version 10.0.22000.434]
WSL Version
- WSL 2
- WSL 1
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:
$ ssh upfront4 bash 19:28:08
Linux upfront4 4.19.0-18-amd64 #1 SMP Debian 4.19.208-1 (2021-09-29) x86_64
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
You have new mail.
Last login: Mon Jan 24 13:19:23 2022 from 102.39.132.97
roche@upfront4:~$ sudo -i
[sudo] password for roche: client_loop: send disconnect: Broken pipe
Diagnostic Logs
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 1
- Comments: 21
what helped a little in my case (
client_loop: send disconnect: Broken pipe) to keep a connection longer is to set theServerAliveCountMaxparameter to a higher value, e.g.100in.ssh/config:The following did not help, but currently in place: in WSL:
in Windows:
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
.ssh/configis used for WSLsshand for the Windows OpenSSH client.I don’t understand, why the ticket has been closed. Guys at MS, you cannot imaging how much time I waste on working around this issue.
I already had the following in
~/.ssh/configbefore logging this issue:I just added
TCPKeepAlive noand I still hit the same error. If it is not a WSL issue, why don’t I experience the same issue when using ssh under Windows?@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.
Hi there. I’m having the same issues.
My log with verbose: