Software⏱️ 3 min read📅 2026-06-04

How to Fix: Putty: Getting Server refused our key Error

Putty key authentication issue on Ubuntu server.

Quick Answer: Check the SSH port and protocol used on the server. Ensure that the private key is in the correct format and try connecting with the correct port (22) and protocol (ssh).

The 'Server refused our key' error occurs when the server is unable to verify the authenticity of your public key. This can happen due to various reasons such as incorrect key format, expired keys, or issues with the SSH protocol.

This error can be frustrating for users who have successfully generated their public-private key pairs using tools like PuTTYgen and uploaded them to the server's authorized_keys file. However, in this case, the server is refusing to accept your key due to an issue that needs to be resolved before you can establish a secure SSH connection.

🔍 Why This Happens

  • The primary reason for this error is that the server may not have been configured correctly to accept public keys from clients. This could be due to a variety of factors such as incorrect permissions on the authorized_keys file, an outdated or incompatible SSH protocol version, or a misconfigured SSH daemon. Additionally, if the key was generated using an older version of PuTTYgen or has expired, it may not be recognized by the server.
  • Alternatively, there could be an issue with the client-side configuration, such as incorrect PuTTY settings or a faulty network connection.

🚀 How to Resolve This Issue

Resolving Server Configuration Issues

  1. Step 1: Check the SSH protocol version on both the client and server sides to ensure they match. You can do this by running `puttygen -server` on the client-side to generate a key pair that matches the server's expected protocol version.
  2. Step 2: Verify that the authorized_keys file has the correct permissions (read-write for the owner, read-only for group and others) using the `chmod` command (e.g., `chmod 600 ~/.ssh/authorized_keys`).
  3. Step 3: Check the SSH daemon configuration on the server-side to ensure it is set up correctly. This may involve editing the sshd_config file or setting environment variables.

Resolving Client-Side Configuration Issues

  1. Step 1: Update PuTTYgen to the latest version and use the `puttygen -server` command to generate a key pair that matches the server's expected protocol version.
  2. Step 2: Verify that the network connection between the client and server is stable and functioning correctly. A faulty connection may cause issues with key exchange.

🎯 Final Words

To resolve the 'Server refused our key' error, first check the server configuration to ensure it is set up correctly to accept public keys from clients. If the issue persists, try resolving any client-side configuration problems by updating PuTTYgen or checking your network connection. By following these steps, you should be able to establish a secure SSH connection with your server.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions