How to pass password automatically for rsync SSH command?

liysd picture liysd · Jul 21, 2010 · Viewed 274.9k times · Source

I need to do rsync by ssh and want to do it automatically without the need of passing password for ssh manually.

Answer

Rajendra picture Rajendra · Oct 24, 2013

Use "sshpass" non-interactive ssh password provider utility

On Ubuntu

 sudo apt-get install sshpass

Command to rsync

 /usr/bin/rsync -ratlz --rsh="/usr/bin/sshpass -p password ssh -o StrictHostKeyChecking=no -l username" src_path  dest_path