Quick and dirty way to do this is to obviously first Install SSH key onto server and then:
ssh-keygen -t dsa
Then get the id_dsa.pub key over to the server or remote machine that only accepts SSH key logins, you can do that with ssh-copy-id or use your preferred method. Using ssh-copy-id you can issue:
ssh-copy-id -i .ssh/id_dsa.pub [email protected]
That’s it! You should now be able to ssh into the remote server without a password and you can lock it down further by turning off password authentications by changing ‘PasswordAuthentication yes’ in the sshd_config file to ‘PasswordAuthentication no’ – just be CAREFUL doing this as you could stop access for others or lock yourself out.
Or on the server:
cat id_dsa.pub >> .ssh/authorized_keys