Generate public/private key pair:
First of all, we need to generate RSA key pair which will be shared with the remote server. It is a bit interactive process. Give the passphrase when asked.
ssh-keygen -t rsa
|

Two file will be generated having names id_rsa (private key) & id_rsa.pub (public key) under ~/.ssh/ directory.
To verify run this command
ls -l ~/.ssh
|

Now copy the public key file to remote server..
ssh-copy-id -i ~/.ssh/id_rsa.pub user@RemoteServerX
|