ssh-keygen -t rsa
2. Now copy the id_rsa.pub to the .ssh directory of the remote host you want to logon to as authorized_keys2 .
scp /home/username/.ssh/id_rsa.pub email@example.com:/home/username/.ssh/authorized_keys2
scp /Users/username/.ssh/id_rsa.pub firstname.lastname@example.org:/Users/username/.ssh/authorized_keys2
3. That’s it. You should now be able to type the following command to get into the box without using a password: