How to automatically accept the remote key when rsyncing?
I know that this was asked 3 years ago, but this was at the top of my google search and I was unable to get either of these solutions in the middle of a Vagrant script to work correctly for me. So I wanted to put here the method that I found somewhere else.
The solution there talks about updating the ~/.ssh/config
or /etc/ssh/ssh_config
file with the following blocks of code.
To disable host key checking for a particular host (e.g., remote_host.com):
Host remote_host.com StrictHostKeyChecking no
To turn off host key checking for all hosts you connect to:
Host * StrictHostKeyChecking no
To avoid host key verification, and not use known_hosts file for 192.168.1.* subnet:
Host 192.168.0.* StrictHostKeyChecking no UserKnownHostsFile=/dev/null
I hope this helps someone else who runs into this issue.