11
Configuring SSH for automated rsync
In order to rsync files between two servers in an automated sense, you need to setup an appropiate SSH key between both the source and destination servers.
Destination Server
$ cd
$ mkdir .ssh
$ chmod 700 .ssh
Source Server
$ cd
$ mkdir .ssh
$ chmod 700 .ssh
$ ssh-keygen -t rsa
Enter file in which to save the key (/home/user/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/user/.ssh/id_rsa.
Your public key has been saved in /home/userch/.ssh/id_rsa.pub.
$ scp id_rsa.pub user@destination.server:.ssh
Destination Server
$ cd .ssh
$ cat id_rsa.pub >> authorized_keys
$ chmod 600 authorized_keys
Source Server
$ ssh user@destination.server
Should it not work, and you are prompted with password the ‘-v’ option may provide some more information to diagnose the problem.


