Software⏱️ 2 min read📅 2026-06-03

How to Fix: Git error no matching host key type found. Their offer: ssh-rsa

Git error resolving host key issue.

Quick Answer: Update the known hosts file on the server or use ssh-keygen to generate a new SSH key.

The error 'no matching host key type found. Their offer: ssh-rsa' occurs when the remote repository's SSH server doesn't recognize your local machine's SSH client. This can happen due to changes in the server's configuration or a mismatch between the expected and actual host keys.

🛑 Root Causes of the Error

  • Incorrect or outdated SSH key configuration on the remote server.
  • Mismatched host keys between your local machine and the remote server.

✅ Best Solutions to Fix It

Method 1: Update SSH Key Configuration

  1. Step 1: Log in to the remote server and run `ssh-keygen -R ` to remove any existing host keys.

Method 2: Add Host Key Manually

  1. Step 1: Run `ssh-keyscan ` to generate the host key fingerprint.
  2. Step 2: Copy and paste the generated fingerprint into your local machine's `~/.ssh/known_hosts` file.

💡 Conclusion

To avoid this error, ensure that the SSH key configuration is up-to-date and consistent between your local machine and the remote server. Regularly update host keys to prevent this issue.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions