Skip to content

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

Closed

Description

  • 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 [email protected]
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: [email protected],[email protected],[email protected],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,[email protected],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: [email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],ssh-ed25519,[email protected],rsa-sha2-512,rsa-sha2-256,ssh-rsa
debug2: ciphers ctos: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]
debug2: ciphers stoc: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]
debug2: MACs ctos: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,[email protected],zlib
debug2: compression stoc: none,[email protected],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,[email protected],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: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]
debug2: ciphers stoc: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]
debug2: MACs ctos: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,[email protected]
debug2: compression stoc: none,[email protected]
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: [email protected] MAC: <implicit> compression: none
debug1: kex: client->server cipher: [email protected] 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 [email protected] it works without any errors, which is so weird. See #5244 (comment)

Activity

  1. sixbitproxywax commented on May 28, 2020

    @sixbitproxywax

    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.

  2. sixbitproxywax commented on May 28, 2020

    @sixbitproxywax

    And since Camber Huang (@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

  3. danztensai commented on Jun 12, 2020

    @danztensai

    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 [email protected]
    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,[email protected],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: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],ssh-ed25519,[email protected],rsa-sha2-512,rsa-sha2-256,ssh-rsa
    debug2: ciphers ctos: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]
    debug2: ciphers stoc: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]
    debug2: MACs ctos: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
    debug2: MACs stoc: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
    debug2: compression ctos: none,[email protected],zlib
    debug2: compression stoc: none,[email protected],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,[email protected],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: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]
    debug2: ciphers stoc: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]
    debug2: MACs ctos: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
    debug2: MACs stoc: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
    debug2: compression ctos: none,[email protected]
    debug2: compression stoc: none,[email protected]
    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: [email protected] MAC: <implicit> compression: none
    debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
    debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
    Connection closed by 205.166.94.16 port 22
    
  4. sixbitproxywax commented on Jun 16, 2020

    @sixbitproxywax

    https://github.com/rescenic/autossh

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

  5. rescenic commented on Jun 16, 2020

    @rescenic

    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

  6. CamberLoid commented on Jun 18, 2020

    @CamberLoid
    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.

  7. rescenic commented on Jun 18, 2020

    @rescenic

    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.
    
  8. danztensai commented on Jun 30, 2020

    @danztensai

    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

  9. kevin820606 commented on Aug 21, 2020

    @kevin820606

    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!

  10. therealkenc commented on Sep 6, 2020

    @therealkenc

    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.

  11. CamberLoid commented on Sep 26, 2020

    @CamberLoid
    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.

  12. therealkenc commented on Sep 26, 2020

    @therealkenc

    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.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions