Generate a pair of private and public keys by running ssh-keygen,
the default location of the private key is ~/.ssh/id_rsa (can be changed),
the public key will be at ~/.ssh/id_rsa.pub
Upload your key to a remote machine by running ssh-copy-id name@host
(you can determine name@host by ifconfig command)