Working in a Linux environment, changes are you’re often using ssh, copying or rsyncing files between servers and workstations. I find it very annoying to always have to type in my login credentials. To avoid that, we can exchange ssh keys so that all the authentication is done utilizing those keys.
We can achieve that by following these two simple steps:
1. Generate a new key
$ ssh-keygen
2. Copy the generated ssh key to the target server(s)
$ cat ~/.ssh/id_rsa.pub | ssh user@target_machine cat – “>>” ~/.ssh/authorized_keys
That’s all there is to exchange ssh keys.