How do I add SSH keys to my Droplet; when I thought I already did? (Error Message below)

June 9, 2015 1.1k views
Server Optimization Configuration Management Linux Commands

Add correct host key in /Users/{$Username}/.ssh/knownhosts to get rid of this message.
Offending ECDSA key in /Users/{$Username}/.ssh/known
ECDSA host key for {$IP_Address} has changed and you have requested strict checking.
Host key verification failed.

2 Answers

Rather than adding it to known hosts, you will need to add it to authorized_keys:

echo "$key" > ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys

After reading through documentation I was able to get it working. Thank you @JonsJava

Have another answer? Share your knowledge.