Report this

What is the reason for this report?

Installing public SSH key

Posted on May 8, 2014
sig

By sig

Hello there. I need to add a public ssh key (from codeship.io) to my Ubuntu 12.04 machine. I have added the key to ~/.ssh/authorized_keys/id_rsa.pub and after that restarted ssh (sudo service ssh restart). However. I’m still not able to log into the server from codeship, so I’d like to know if the public key has been installed correctly. Is there a way to verify it?

Thanks.



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.

You don’t need to copy <pre>~/.ssh/authorized_keys/id_rsa.pub</pre> itself to the server. You need to copy its contents into the file <pre>~/.ssh/authorized_keys </pre> on the server. That file can contain multiple public keys that you have authorized to access your server. <br> <br>Check out this article for all the info: <br> <br>https://digitalocean.com/community/articles/how-to-set-up-ssh-keys--2 <br> <br>To make a long story short, you could do it like so: <br> <br><pre> <br>cat ~/.ssh/id_rsa.pub | ssh user@123.45.56.78 “cat >> ~/.ssh/authorized_keys” <br></pre>

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.