How can I set up a rsync between two hosts without providing any password?
migrated from stackoverflow.com Feb 22 '13 at 13:58
This question came from our site for professional and enthusiast programmers.
1. Test rsync over ssh (with password):
Do a rsync to make sure it asks for the password for your account on the remote server, and successfully copies the files to the remote server.
The following example will synchronize the local folder
This should ask you for the password of your account on the remote server.
2. ssh-keygen generates keys.
Enter passphrase (empty for no passphrase):
Enter same passphrase again: Note: When it asks you to enter the passphrase just press enter key, and do not give any password here.
3. ssh-copy-id copies public key to remote host
Note: The above will ask the password for your account on the remote host, and copy the public key automatically to the appropriate location. If ssh-copy-id doesn’t work for you, use the method we discussed earlier to setup ssh password less login.
4. Perform rsync over ssh without password
Now, you should be able to ssh to remote host without entering the password.
Perform the rsync again, it should not ask you to enter any password this time.
Genarate the public key in ServerA
The public key will be generated and stored in
Copy public key to remote host
I followed this article and it helps me http://namhuy.net/961/rsync-with-ssh-without-prompting-for-password.html