Generate key on local machine
ssh-keygen -t rsa
Ensure that the remote server has a .ssh directory
Make sure the server your connecting to has a .ssh directory in the home directory of the user you are doing this for. If it doesn’t exist you can run the ssh-keygen command above, and it will create one with the correct permissions.
Copy your local public key to the remote server
If your remote server doesn’t have a file called ~/.ssh/authorized_keys then create it. If that file already exists, you need to append the contents of ~/.ssh/id_rsa.pub to it.
cat ~/.ssh/id_dsa.pub | ssh user@remote.server "cat - >> ~/.ssh/authorized_keys"
Now ssh to the remote server
Your should be able to ssh to the remote server without being asked for a password.
Security
All someone would need to login to the remote server, is one file on your local machine ~/.ssh/id_rsa, so keep it secure.
Getting asked for a password
If you are getting asked for a password, check the permissions.
server$ chmod 700 ~/.ssh
server$ chmod 600 ~/.ssh/authorized_keys