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

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

Process: Didn’t setup SSH during droplet creation.

PuttyGen > public_key & private_key Enter public_key into SSH Key field in settings>security Open Putty > Enter IP / private_key.ppk

What am I missing here?

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.


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.