On the source machine:
ssh-keygen -t rsa -C %user%@%target% Enter a passphrase if you want, it is not necessary
cat ~/.ssh/id_rsa.pub | ssh %user%@%target% 'cat >> .ssh/authorized_keys'
Authorized Keys file on target machine
.ssh/authorized_keys is a file on the target machine and should be mode 600.