the easiest way to copy your public key to your droplet is with SCP. On a typical Linux/macOS machine, you’d do the following:
scp ~/.ssh/id_rsa.pub username@<droplet_IP>:~/.ssh/authorized_keys
~/.ssh/id_rsa.pub is the location & name of your public key on your local machine. Also, be sure to replace
username with the actual username on your droplet and enter the correct IP. Also, note the colon character between the droplet’s IP and the path of the
authorized_keys file on your droplet.
It might also be a good idea to ensure the
.ssh directory on your droplet has proper permissions. On your droplet, you might want to run this first:
sudo chmod -R 700 ~/.ssh/