Algorithm Negotiation failed when trying to connect to server

26,766

Solution 1

You are connecting to new system (Ubuntu 16.04) from some very old SSH client that does not support any contemporary algorithms and this is a reason why it fails to connect. You should really update your client.

Or continue enabling the outdated protocols that might not be secure today. Using

KexAlgorithms +diffie-hellman-group1-sha1
Ciphers +aes128-cbc

you should be able to connect.

Solution 2

Add below code into file: /etc/ssh/sshd_config

KexAlgorithms +diffie-hellman-group1-sha1
Ciphers +aes128-cbc

Now restart Service

Share:
26,766

Related videos on Youtube

yaylitzis
Author by

yaylitzis

Updated on September 18, 2022

Comments

  • yaylitzis
    yaylitzis over 1 year

    I installed openssh-server in Ubuntu server 16.04 and in /etc/ssh/ssh_config I added:

    MaxAuthTries 3
    PasswordAuthentication YES
    

    and then restarted the ssh server. When I try to connect from a a different pc with ssh I get a message Algorithm Negotiation failed

    back in server, when I run systemctl status ssh I get this error

    Unable to negotiate with 192.168.0.132 port 63428: no matching key exchange method found. Their offer: diffie-hellman-group1-sha1

    I edit the /etc/ssh/sshd_config add I add the line

    KexAlgorithms=+diffie-hellman-group1-sha1
    

    and now I get a different error, when I run the systemctl status ssh

    Unable to negotiate with 192.168.0.132 port 63428: no matching key exchange method found. Their offer: aes128-cbc,3des-cbc, blowfish-cbc,cast128-cbc,twofish-cbc,arcfour [preauth]

  • yaylitzis
    yaylitzis about 7 years
    I used open ssh client to login to my server. I didn't realize that the client was the problem. I downloaded putty, delete the entries I added and I login successfully. Thanks for the info!
  • Jakuje
    Jakuje about 7 years
    The client is not a problem. The "old client" is a problem. You can download up-to date OpenSSH too.