Installing public SSH key

May 8, 2014 2.4k views
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? Thanks.
1 Answer
You don't need to copy
itself to the server. You need to copy its contents into the file
on the server. That file can contain multiple public keys that you have authorized to access your server.

Check out this article for all the info:

To make a long story short, you could do it like so:

cat ~/.ssh/ | ssh user@ "cat >> ~/.ssh/authorized_keys"
by Etel Sverdlov
SSH keys provide a more secure way of logging into a virtual private server with SSH than using a password alone. With SSH keys, users can log into a server without a password. This tutorial explains how to generate, use, and upload an SSH Key Pair.
Have another answer? Share your knowledge.