Linux - SSH Login Key

There are a number of tutorials teaching how to set up SSH Client Key, however they will require a copy of private key inside your ./ssh/known_hosts.   It could be difficult to manage and brings troubles when you are accessing from another device.

Method (operates on local machine):

# ssh-keygen -t rsa
# cat ~/.ssh/id_rsa.pub | ssh user@server 'cat >> .ssh/authorized_keys'
# openssl rsa -in ~/.ssh/id_rsa -out key.pem


The last line was used to generate a .pem key file, so that we can use this key file to access the server, via:

# ssh -i key.pem user@server

Connecting via Windows:
http://tuts.pinehead.tv/2011/11/21/connect-to-amazon-ec2-using-putty-private-key-on-windows/

Reference on RSA Key:
http://en.wikipedia.org/wiki/RSA_(algorithm)