Bypass Rsync Prompt "Are you sure you want to continue connecting"

user1480718 picture user1480718 · Aug 6, 2012 · Viewed 14.1k times · Source

How do you bypass this question or add a flag that auto answers this?

Because I am trying to write a script, and this question keeps stopping the process of rsync since there is no way to answer this in the script when prompted.

Answer

Igor Chubin picture Igor Chubin · Aug 6, 2012

Set the StrictHostKeyChecking option to no, either in the config file or via -o.

Use e option of rsync to pass options to ssh:

-e "ssh -o StrictHostKeyChecking=no"