4

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]

3

And the questions is?

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.

  • 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! – yaylitzis Mar 10 '17 at 11:49
  • The client is not a problem. The "old client" is a problem. You can download up-to date OpenSSH too. – Jakuje Mar 10 '17 at 11:50
1

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

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

Now restart Service

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.