SSH troubles: ssh_exchange_identification/kex_exchange_identification: Connection closed by remote host

13,081

Try capturing an ssh debug (ssh -vvv ) and see what it tells you. You should see the kex exchange info which will tell you which kex algo's the server supports, which ones the client supports, and if successful, which one they agreed on.

It will also give you more information that might show exactly where the failure is.

Share:
13,081
LeRookie
Author by

LeRookie

Updated on September 18, 2022

Comments

  • LeRookie
    LeRookie over 1 year

    I am connecting to my hoster's server via ssh/scp, mostly from Linux machines, and things were working well for years.

    Now, all of a sudden, the majority of all connection attempts fail before getting to the password prompt with the following errors (depending on the SSH client version):

    > kex_exchange_identification: Connection closed by remote host
    > Connection closed by xxx.xxx.xxx.129 port 22
    

    or

    > ssh_exchange_identification: Connection closed by remote host
    > Connection closed by xxx.xxx.xxx.129 port 22
    

    Some connection attempts work, though, and also keep a stable connection. This was confirmed with multiple clients:

    1. JuiceSSH on Android
    2. OpenSSH_8.3p1 on Linux (current)
    3. OpenSSH_6.0p1 on Linux (legacy, never updated)
    4. FileZilla

    and from multiple networks. Nevertheless, my hoster keeps blaming my clients or my IP address.

    Any advice how to track that down further? (Yes, I know I should switch from a hoster as incompetent as this one, but moving all the services would take me a week ...)