If you've lost your private SSH key, you can regain access to your server, create a new SSH key, and associate it with your server.
First, log in to your DigitalOcean control panel, click on your droplet name and navigate to the 'Access' panel, then click 'Reset Root Password'. A root password will be emailed to you.
When you next log into your server (via SSH in the Mac/Linux terminal or PuTTY on Windows), you'll be prompted for the root password that was emailed to you. Enter it, and once connected you'll be asked to enter this same password again as your 'current UNIX password'. followed by a new root password. This passphrase should be as random as possible and is temporary, as we'll be switching back to SSH key-based access instead.
Obtain the public portion of then new key, then plug it into the command below, running it in your DigitalOcean droplet's command line:
echo -e "your public SSH key between quotes" > ~/.ssh/authorized_keys
echo -e "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCm/Cv/kgU7Ot+OR/Dll4+fAC+lFR0rHC1tFgquMiozgfPFv44jMHe/A/2mvt5zljXQrbH/k4zfQFYAehRzqswXyBheR+6X02q5taFRDm7GKyCGOng2QCbhn/SSm4AeeIIGcNXZZhEo87mm/8VH5nrql3NPQqXs4PIz8HL1bfKHR6VKpcessubKJFYzFOjY5ckgvOvGWjIwvjxnCk24M4UpURWXvAQvAEENox0tsbYdqjabjkLC0TofKvQFU0p0pRT8y3JsGezNQDIhTyNGPcsSmC5KrIBORCi2Gzp5/PY+ftl3jZnNnS5oAhuQ3RyFO6HHphj7WS70D1Q0szRmbju9 firstname.lastname@example.org" > ~/.ssh/authorized_keys
After running in your server, it will go to the next line without output.
Now, we'll disable the password based login option, reverting to using only your new SSH key. Run the following two commands individually:
curl -#o /etc/ssh/sshd_config https://raw.githubusercontent.com/naconner/cacti/master/replace/sshd_config service ssh restart
If using Windows, configure PuTTY to use the new private key when logging into your server (replicate the steps related to PuTTY in the Windows-specific video of the original setup article.)