In the article rsync server setup on rhel, I've described how to setup rsync server, now here is a bit more instructions for who wants to use rsync with ssh.


Basically, it's the same way you setup ssh key authentication, so good part is that your rsync process will be performed via secured connection, but bad part is that there is potential security danger. Anyway, in most cases, rsync and ssh key setup are mostly setup internal network, so best leave it to you to judge.

On, Client

# ssh-keygen -f ~/.ssh/id_rsa -q -P ""
# cat ~/.ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEArmk2v6GnCp50uTjnV36hrs4bapBeoonubD8eU4WmPSoxiZWZrF12/xhBLSltw52znCbpnFmHhgxXyun3Lc0SxPY4b2Riw/eU9duYkQ+vK4QeGLrnDVx1ReNNwpVwB6KmVZtljVB7FN3UgMaT9Yb32kQ2UG4dYLQiUJZjzqamTvh6mSp48onNJ8yhOgcRUQYDAcOqaokgIr6ltuHO0nb1i5KFhbekkCLgaatLl/wcp3aGLQy4ojCcCLRvOaklwUvwFIvF9kLIt9S/+kPa7KmBrRXEKqHTRcOpW3MnFBgLdbt0QfAyW6+m9RyGJXOyDwHWbK5nI6Wql+ERBiWImLrJFQ== This email address is being protected from spambots. You need JavaScript enabled to view it.

On Server

copy it to a file or clipeboard, then on server
add it to ~/.ssh/authorized_keys

cat id_rsa.pub >>~/.ssh/authorized_keys

then run

# rsync -auvx -e 'ssh' testrsyncserver::backups/ .
receiving incremental file list
./
...
sent 36 bytes received 56 bytes 61.33 bytes/sec
total size is 0 speedup is 0.00


You are all done.