Installing public SSH key

  • Posted May 8, 2014

Hello there. I need to add a public ssh key (from to my Ubuntu 12.04 machine. I have added the key to ~/.ssh/authorized_keys/ 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?



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.

You don’t need to copy <pre>~/.ssh/authorized_keys/</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> <br> <br>To make a long story short, you could do it like so: <br> <br><pre> <br>cat ~/.ssh/ | ssh user@ “cat >> ~/.ssh/authorized_keys” <br></pre>