Search code examples
sshopenssh

SSH - kex protocol error: type 30 seq 1 [preauth]


After upgrade from ubuntu 18 to ubuntu 20 my SSH work well. But in some cases connections with some servers - user receive timeout. How to solve this?

Command systemctl status ssh shows:

error: kex protocol error: type 30 seq 1 [preauth]

SSH version:

OpenSSH_8.2p1 Ubuntu-4ubuntu0.5, OpenSSL 1.1.1f  31 Mar 2020

Thanks in advance.


Solution

  • The key is looking for some legacy options in ssh configuration.

    Adding

    KexAlgorithms +curve25519-sha256,curve25519-sha256@libssh.org,diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,sntrup4591761x25519-sha512@tinyssh.org
    

    Solves error: kex protocol error: type 30 seq 1 [preauth]

    You can set KexAlgorithms that way:

    KexAlgorithms +<key_exchange_method1>,<key_exchange_method2>,...
    

    The main point you can find:

    man sshd_config