SSH Login Without Password

SSH Login Without Password

root@local-host$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):[Enter key]
Enter passphrase (empty for no passphrase): [Press enter key]
Enter same passphrase again: [Press enter key]
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.

ssh-copy-id -i ~/.ssh/id_rsa.pub remote-hostname-or-ip
root@remote-hostname’s password:
Now try logging into the machine, with “ssh ‘remote-hostname'”, and check in:

ssh remote-hostname
Last login: Wed Nov 07 17:22:33 2016 from xxx.xxx.xxx.xxx

[Note: did not ask for password.]