Tuesday, December 16, 2014

[Quick Tips] : Rsync with SSH without prompting for password

Rsync with SSH without prompting for password


Rsync or Remote Sync is an open source free utility computer program under GNU General Public License which is most commonly used linux/unix command to copy and synchronize files and directories locally or remotely while minimizing data transfer using delta transfer algorithm encoding when appropriate.
What is good about rsync ?
  • Faster than scp (secure copy) because scp does not have transfer  optimizations
  • More secure than ftp, ftp can transfer data but without any encrytion
  • rsync can tranfer data faster than SMB, ftp, scp
  • rsync packets is well defined with header and has a definite length
To install rsync
For ubuntu or debian
For RHEL/CentOS 4.x or older
For RHEL/CentOS 5.x or newer or Fedora
** Always use rsync over ssh because rsync does not provide any security while transferring data.

rsync over ssh (with password)
To use a different ssh port, e.g., 123:
The terminal will prompt for password before proceed.
To rsync without prompting for password, we can generate a ssh public key and add it to backup server’s ssh authorized keys. Below are the steps.
Assuming the file server is ServerA and backup server is ServerB
Genarate the public key in ServerA
The public key will be generated and stored in
Copy public key to remote host
You can read detailed article how to SSH login without password to setup ssh without password correctly.
rsync command options

No comments: