Key exchange error fix

Putty often presents its users with a ‘Couldn’t Agree a Key Exchange Algorithm’ error when they try to connect to a remote server or EC2 instance. This advice won’t fix every occurrence of that fatal error, but it might just solve your issue.

The most common reason why DevOps professionals encounter this error is because they’re using an outdated version of Putty. If you try to connect to a remote server or cloud based resource with Putty 0.67 or older, you’re going to encounter this ‘error message:

Key Exchange Algorithm Fatal Putty Error

You can usually fix Putty’s Key Exchange Algorithm fatal error by upgrading to a newer version of the tool.

‘Agree to a key’ fix

The first remedy to try is to download a new version of Putty. It’s not an onerous task: the download is free, the license is permissive, and the file is less than 10 MB in size.

Post SSH Key generation tasks

After you’ve run the SSH keygen command, you’ll need to push, pull and clone with Git. Here are some quick tutorials to show you how:

  • Learn to configure  GitHub and SSH keys to push and pull
  • Not an Ubuntu user? Use GitHub with SSH on Windows
  • Git busy and do a GitHub clone using SSH keys
  • Maybe you use GitLab?  Connect to GitLab over SSH
  • Maybe you use Atlassian? Here’s a BitBucket over SSH example
  • Need help to  find the GitHub SSH URL? We’ll show you where it is
  • Fix, solve and eliminate the GitHub Permission Denied (publickey) Error

Always use the most up to date software when you connect to server-side resources. This helps protect you against software bugs that could compromise the security and confidentiality of your communications, and also avoid annoying, intermittent software errors like this one.


Cameron McKenzie Cameron McKenzie is an AWS Certified AI Practitioner, Machine Learning Engineer, Solutions Architect and author of many popular books in the software development and Cloud Computing space. His growing YouTube channel training devs in Java, Spring, AI and ML has well over 30,000 subscribers.