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

[WSL2] Encountered issues on OpenSSH at Ubuntu 20.04 LTS #5244

Closed
CamberLoid opened this issue May 21, 2020 · 14 comments
Closed

[WSL2] Encountered issues on OpenSSH at Ubuntu 20.04 LTS #5244

CamberLoid opened this issue May 21, 2020 · 14 comments

Comments

@CamberLoid
Copy link

CamberLoid commented May 21, 2020

  • Your Windows build number: (Type ver at a Windows Command Prompt)

19624

  • What you're doing and what's happening: (Copy&paste the full set of specific command-line steps necessary to reproduce the behavior, and their output. Include screen shots if that helps demonstrate the problem.)

At local WSL2 Ubuntu 20.04 LTS instance

# camber @ Camber-Laptop in ~ [15:49:22]
$ ssh -vvv root@hikari.camber.moe
OpenSSH_8.2p1 Ubuntu-4, OpenSSL 1.1.1f  31 Mar 2020
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 *
debug2: resolving "hikari.camber.moe" port 22
debug2: ssh_connect_direct
debug1: Connecting to hikari.camber.moe [101.132.134.54] port 22.
debug1: Connection established.
debug1: identity file /home/camber/.ssh/id_rsa type 0
debug1: identity file /home/camber/.ssh/id_rsa-cert type -1
debug1: identity file /home/camber/.ssh/id_dsa type -1
debug1: identity file /home/camber/.ssh/id_dsa-cert type -1
debug1: identity file /home/camber/.ssh/id_ecdsa type -1
debug1: identity file /home/camber/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/camber/.ssh/id_ecdsa_sk type -1
debug1: identity file /home/camber/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /home/camber/.ssh/id_ed25519 type -1
debug1: identity file /home/camber/.ssh/id_ed25519-cert type -1
debug1: identity file /home/camber/.ssh/id_ed25519_sk type -1
debug1: identity file /home/camber/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /home/camber/.ssh/id_xmss type -1
debug1: identity file /home/camber/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.2p1 Ubuntu-4
debug1: Remote protocol version 2.0, remote software version OpenSSH_8.2p1 Ubuntu-4
debug1: match: OpenSSH_8.2p1 Ubuntu-4 pat OpenSSH* compat 0x04000000
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to hikari.camber.moe:22 as 'root'
debug3: hostkeys_foreach: reading file "/home/camber/.ssh/known_hosts"
debug3: record_hostkey: found key type ECDSA in file /home/camber/.ssh/known_hosts:2
debug3: load_hostkeys: loaded 1 keys from hikari.camber.moe
debug3: order_hostkeyalgs: prefer hostkeyalgs: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
debug3: send packet: type 20
debug1: SSH2_MSG_KEXINIT sent
debug3: receive packet: type 20
debug1: SSH2_MSG_KEXINIT received
debug2: local client KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,ext-info-c
debug2: host key algorithms: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,sk-ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,sk-ecdsa-sha2-nistp256@openssh.com,ssh-ed25519,sk-ssh-ed25519@openssh.com,rsa-sha2-512,rsa-sha2-256,ssh-rsa
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,zlib@openssh.com,zlib
debug2: compression stoc: none,zlib@openssh.com,zlib
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug2: peer server KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256
debug2: host key algorithms: rsa-sha2-512,rsa-sha2-256,ssh-rsa,ecdsa-sha2-nistp256,ssh-ed25519
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,zlib@openssh.com
debug2: compression stoc: none,zlib@openssh.com
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug3: send packet: type 30
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
Connection closed by 101.132.134.54 port 22

At remote Ubuntu 20.04 LTS (journalctl -e --unit=ssh.service)

sshd[7477]: error: kex_input_kexinit: discard proposal: string is too large [preauth]
sshd[7477]: ssh_dispatch_run_fatal: Connection from [MyIP] port 27510: string is too large [preauth]
  • What's wrong / what should be happening instead:

Referring to #4208 , which is closed for a long time:

in wsl2 when I use ssh to login a remote server, the connection closed immediately

I encountered the exactly same issue.
It's weird because I don't have the issue on my other WSL2 instance, like debian, and neither does my friend's. As the previous issue is closed for a long time, and even i got my workaround, I think I should open this new issue with some detailed information to figure what's wrong.

  • Strace of the failing command, if applicable: (If some_command is failing, then run strace -o some_command.strace -f some_command some_args, and link the contents of some_command.strace in a gist here).

I tried, but by running strace -o ssh.strace -f ssh -vvv root@hikari.camber.moe it works without any errors, which is so weird. See #5244 (comment)

@sixbitproxywax
Copy link

sixbitproxywax commented May 28, 2020

Just to add another data point, ssh works for:

  • Ubuntu 18.04 (WSL 1 & 2)
  • SuSe Linux (WSL 1 & 2)
  • Debian (WSL 1 & 2)
  • Ubuntu 20.04 (WSL 1 only)

At least in my particular case.

I also attempted to do a distribution upgrade from 18.04 to 20.04 using WSL2, and this also failed to work.

@sixbitproxywax
Copy link

And since @CamberLoid couldn't get a trace, perhaps mine will work as a substitute (our debug output seems similar enough to assume we might be having the same issue):

Here's the gist

@danztensai
Copy link

Just to add another data point, ssh works for:

  • Ubuntu 18.04 (WSL 1 & 2)
  • SuSe Linux (WSL 1 & 2)
  • Debian (WSL 1 & 2)
  • Ubuntu 20.04 (WSL 1 only)

At least in my particular case.

I also attempted to do a distribution upgrade from 18.04 to 20.04 using WSL2, and this also failed to work.

for my case it wont work on ubuntu 18.04(WSL 1 & 2) even Ubuntu 20.04(WSL 1& 2). cant do any SSH connection,


`danz@DESKTOP-HTRGUM3:~$ ssh -vv new@sdf.org
OpenSSH_8.2p1 Ubuntu-4, OpenSSL 1.1.1f  31 Mar 2020
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 *
debug2: resolving "sdf.org" port 22
debug2: ssh_connect_direct
debug1: Connecting to sdf.org [205.166.94.16] port 22.
debug1: Connection established.
debug1: identity file /home/danz/.ssh/id_rsa type -1
debug1: identity file /home/danz/.ssh/id_rsa-cert type -1
debug1: identity file /home/danz/.ssh/id_dsa type -1
debug1: identity file /home/danz/.ssh/id_dsa-cert type -1
debug1: identity file /home/danz/.ssh/id_ecdsa type -1
debug1: identity file /home/danz/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/danz/.ssh/id_ecdsa_sk type -1
debug1: identity file /home/danz/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /home/danz/.ssh/id_ed25519 type -1
debug1: identity file /home/danz/.ssh/id_ed25519-cert type -1
debug1: identity file /home/danz/.ssh/id_ed25519_sk type -1
debug1: identity file /home/danz/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /home/danz/.ssh/id_xmss type -1
debug1: identity file /home/danz/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.2p1 Ubuntu-4
debug1: Remote protocol version 2.0, remote software version OpenSSH_8.0
debug1: match: OpenSSH_8.0 pat OpenSSH* compat 0x04000000
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to sdf.org:22 as 'new'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: local client KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,ext-info-c
debug2: host key algorithms: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,sk-ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ecdsa-sha2-nistp256@openssh.com,ssh-ed25519,sk-ssh-ed25519@openssh.com,rsa-sha2-512,rsa-sha2-256,ssh-rsa
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,zlib@openssh.com,zlib
debug2: compression stoc: none,zlib@openssh.com,zlib
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug2: peer server KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1
debug2: host key algorithms: ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa,ssh-ed25519
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,zlib@openssh.com
debug2: compression stoc: none,zlib@openssh.com
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ssh-ed25519
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
Connection closed by 205.166.94.16 port 22

@rescenic
Copy link

@sixbitproxywax
Copy link

https://github.com/rescenic/autossh

I don't believe this actually addresses the problem. If it does, could you explain how?

@rescenic
Copy link

It's not WSL fault.
SSH works, if 'dmesg' error doesn't appear at the startup (it means in normal startup).

See your logs: debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
Try this solution from ServerFault:
https://serverfault.com/questions/210408/cannot-ssh-debug1-expecting-ssh2-msg-kex-dh-gex-reply
https://www.seei.biz/ssh-fails-to-connect-with-debug1-expecting-ssh2_msg_kex_ecdh_reply/

Ubuntu SSH to Windows:
o1
o2
o3

@CamberLoid
Copy link
Author

The two address have pointed a possible point.
But I have tried before creating the issue and found it not working, meaning setting MTU might not be a solution.

@rescenic
Copy link

rescenic commented Jun 18, 2020

Try this: https://superuser.com/questions/699530/git-pull-does-nothing-git-push-just-hangs-debug1-expecting-ssh2-msg-kex-ecd
From RHEL:

Resolution
Check MTU on both server and client and change to 1500.

Root Cause
There are some devices with MTU that is below than 2000 between server and client.

Diagnostic Steps
Check server and client's interface MTU.

@danztensai
Copy link

danztensai commented Jun 30, 2020

Hi there I fix this problem by updating my wifi driver , it seems wsl 2 kinda have problem with old driver
I'm using killer Wifi , try to update your wifi driver guys

based on this link
#4253

@kevin820606
Copy link

Hi there I fix this problem by updating my wifi driver , it seems wsl 2 kinda have problem with old driver
I'm using killer Wifi , try to update your wifi driver guys

based on this link
#4253

I stuck on this problem for weeks, and your suggest is totally work! Thanks!

@therealkenc
Copy link
Collaborator

Please collect WSL logs and post the backlink to the feedback item here. Also please identify any third-party networking software that has been installed on Windows.

@CamberLoid
Copy link
Author

Sorry guys, Camber's here.
I'm feeling appreciated to hear responses from collaborator and same issue from other guys. However my previous device (Xiaomi Mi Gaming Laptop 2018) was broken and not able to use.
As it is out of warranty I'm planning to switch to ROG Zephyrus G15. So that I'm afraid I cannot reproduce anymore.
I will leave the issue open to see if any other fellows can help reproduce and upload the logs. Anyone helping this out will be much appreciated.
Stay safe. Camber out.

@therealkenc
Copy link
Collaborator

Thanks for the follow-up Chamber, it is very appreciated. Let's call this spiritually /dupe #4253. Some drivers do not seem to handle mismatched MTUs well. Or, at least that is a plausible working theory.

Anyone still seeing the OP fail "error: kex_input_kexinit: discard proposal: string is too large [preauth]" please submit a new issue following the template, including WSL logs.

@ghost
Copy link

ghost commented Sep 26, 2020

Hi! We've identified this issue as a duplicate of another one that already exists in this repository. This specific instance is being closed in favor of tracking the concern over on the referenced thread.

Thanks for your report!

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

No branches or pull requests

6 participants