Cant add SSH keys to known hosts file

I’ve created my SSH keys but I’m unable to add them to my “known hosts file” I followed these instructions: everything works fine until I get to the “Are you sure you want to continue connecting (yes/no)? yes” after that I get nothing

Basically I’m using wordpress, server pilot, and digital ocean and want to create SSH keys as my droplet was created without them.


Unfortunately I can’t get past that point, it asks me for a password and none of my passwords work. My problem is I already created the droplet without SSH as per the serverpilot instructions and have yet to find a way to enable the SSH keys after the fact.

What am i supposed to replace “user” with? … i understand I need to add the correct IP

you actually want to copy the public key (from your laptop/desktop) to the “~/.ssh/authorized_keys” file on the droplet server.

the applicable line from the tutorial is below. When it gives the prompt “you want to continue connecting”, input “yes” and the droplet host fingerprint to your own laptop / desktop known_hosts file.

cat ~/.ssh/ | ssh user@ "mkdir -p ~/.ssh && cat >>  ~/.ssh/authorized_keys"

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

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.

Another way to do this with Userify is to paste the Userify shim installer into the “UserData” portion when creating your droplet (or, since you’ve already created it, just paste it right into the server console.). Then, it’s easy - Userify just creates the user account, set up the SSH keys, and set up sudoers for that user account so you can sudo. Don’t forget to enable MFA :)