1. Generate your ssh key pair if you haven’t one. Use default values, don’t set password
1 |
$ ssh-keygen |
2. Copy your public key to a remote host (192.168.0.5 for instance)
1 |
$ ssh-copy-id -i ~/.ssh/id_rsa.pub 192.168.0.5 |
Explanation: ssh-copy-id is a special command – it simply appends your public ssh key to .ssh/authorized_keys of a remote host. Then your private key is used when you login onto the machine, you no longer need to type the user’s password.