Secure your SSH transactions with keys

To automate rsync backups between 2 Linux machines, you have to use SSH keys. These keys allow you to connect through SSH without typing any password.

First, you need to generate public key on the client (only for the current user). Do not answer to the following questions :

ssh-keygen -t dsa -b 1024

Now, you have 2 generated files for the current user : ~/.ssh/id_dsa for the private key and ~/.ssh/id_dsa.pub for the public one. Then, you must copy the public key to the server authorized keys's list and that's all !

ssh-copy-id -i ~/.ssh/id_dsa.pub distant_user@server

post a comment