Create and setup SSH keys
To create the SSH key you will need to run
ssh-keygen -t rsa
You are then prompted with a few options you will be asked for the directory to save the key file to, default is fine
Enter file in which to save the key (/home/user/.ssh/id_rsa):
You have teh option to specify a passphrase/password for the key file this can be left blank of you do not want to have a passphrase
Enter passphrase (empty for no passphrase):
Now this should have completed and your keys have been created ready for use.
To allow access on another machine you now need to copy the public key to the servers authorized_keys file
or you can copy the contents of the id_rsa.pub file to the authorized_keys file
cat ~/.ssh/id_rsa.pub | ssh firstname.lastname@example.org "cat >> ~/.ssh/authorized_keys"
you can now test this by trying to ssh into the server
You should now be logged into the server.
As an additional step you can disable root access to only all access via SSSH keys
To do this you will need to edit the sshd_config file and update the line for PermitRootLogin
once you have updated the file save and restart ssh
service ssh restart
Hope this helps you with the setup of SSH keys