SSH Key + Putty - from "refused our key" to "unable to open key file"

Posted July 2, 2015 33.7k views

I’ve gone through all the tutorials. At first I was getting “refused our key” now I’m getting “unable to open key file”.

Didn’t setup SSH during droplet creation.

PuttyGen > publickey & privatekey
Enter publickey into SSH Key field in settings>security
Open Putty > Enter IP / private

What am I missing here?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer


I apologize but there isn’t enough information here to really provide much help. Have you tried this article here

Some things to note. Make sure you are including the OpenSSH public key and not the putty public key. An Open SSH key starts with ssh-rsa and is the one you need to include on the settings page.

In your Putty SSH settings go to Connection -> SSH -> Auth Then make sure the box Private key file for authentication points to the matching .ppk file. Make sure this .ppk file is located in a location that your local computer can read. If it’s not, you will get the cannot read private key error.

Once thing of note, if it’s an existing droplet, and you did not include the key on create, updating the settings -> security section won’t work. The DO Control panel can only add keys to new droplets. If you need to add your key to an existing droplet, please do the following.

  1. Log into the droplet over SSH with a password.
  2. Open the ~/.ssh/authorized_keys file with something like nano. You can find a guide on using nano here (This whole guide is great if you are new to working with a terminal btw)
  3. Make a new line and copy and paste the public key over. If you are using putty, you can copy it with Ctrl + C then right click on the putty window. Right click with putty is paste.
  4. Save the file and exit out. Now you should be able to log in with the key pair.
by Pablo Carranza
This tutorial runs through creating SSH keys with PuTTY to connect to your virtual server.
  • Thank you. I was trying to add SSH to an existing droplet and most of the tutorials presented over here didn’t work. The pointers you gave here definitely helped.