Report this

What is the reason for this report?

How To Use SSH Keys to login console?

Posted on June 10, 2014

I have created droplet without key. How I can connect the added key to my actual droplets?

BR



This textbox defaults to using Markdown to format your 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.

mkdir ~/.ssh && echo “ssh-rsa AAAAB…” >> ~/.ssh/authorized_keys

You simply need to copy the contents of your public key into the file ~/.ssh/authorized_keys on the server. On the local machine, run:

<pre> ssh-copy-id root@your.ip.address </pre>

If you don’t have the ssh-copy-id command, you can use:

<pre> cat ~/.ssh/id_rsa.pub | ssh root@your.ip.address “cat >> ~/.ssh/authorized_keys” </pre>

I have followed the steps required in order to get my SSH key going

  • I created the directory .ssh and the file authorized_keys under home/usr

  • I copied the contents of the public key straight from PuttyGen and pasted it into the file home/usr/.ssh/authorized_keys

  • I configured putty to use the correct private key file located on my windows machine

When attempting to log in I get the message “Server refused our key” and then I’m prompted with a login. I have no idea what I’m doing wrong here…

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.