Check if you already have a public key
ls .ssh/id_rsa.pub
If not, generate one
ssh-keygen -t rsa
Make sure the .ssh
directory exists on the remote host, then append the key to the authorized_keys
file (from the client, to the remote host):
cat .ssh/id_rsa.pub | ssh user@remotehost 'cat >> .ssh/authorized_keys'