Let say you want to access to a machine with IP 10.0.0.4, and make sure you have command ssh, ssh-keygen, ssh-copy-id.
First, generate the key, the key will be used to open the remote machines door.
ssh-keygenYou will see something like that
Enter file in which to save the key (/home/myname/.ssh/id_rsa):Whatever it appears just press enter until it ends, press enter for passphase as well.
Okay, the key will be generated, something looks like ~/.ssh/id_rsa.pub
Copy over the key to remote machine, and enter your password
ssh-copy-id -i ~/.ssh/id_rsa.pub email@example.comDone. Now you can ssh 10.0.0.4 with username mysurface without password.