How to Add SSH Key to existing Droplet

Simon Bennett
Simon Bennett ยท Jan 24, 2020

So you have a pre-existing droplet and you have lost your SSH keys locally and can no longer log in. Let's say its even worse, you have SSH password login's disabled. Your locked out!

Adding your keys to your DigitalOcean settings will not add them to existing servers, only offer at the time of creation.

There are two options

Option 1 SnapShot and Recreate

Option one is the simplest to execute however you end up with a new IP address for your droplet which is no ideal and would require a DNS change.

Step 1

  • Take a snapshot of your droplet from DigitalOcean

Step 2

  • Create a new droplet from the snapshot, at creation time you will be asked to select your SSH keys, make sure you add the correct one.

Step 3

  • After the new droplet is created, check you can see in with your SSH Keys.

Step 4

  • You can now delete your original droplet.