Common Practice
Easiest way:$ ssh-copy-id remotehostname
Sometimes, we may encounter
/usr/bin/ssh-copy-id: ERROR: No identities found
In that case, do:
$ ssh-copy-id -i ~/.ssh/id_rsa.pub remotehostname
If known_hosts has offending key
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
.
.
.
Offending key in /root/.ssh/known_hosts: 6
.
.