I'm Rsync-ing with the following command:
# rsync -arvce ssh /tmp/rsync/file.txt user@domain:/tmp/rsync/
This works fine, and I will have to do this for multiple places, so I want to implement the StrictHostKeyChecking
option.
After reading other online examples I've added the option like this (3 examples):
# rsync -arvce ssh -o 'StrictHostKeychecking no' /tmp/rsync/file.txt user@domain:/tmp/rsync/ # rsync -arvce ssh -o 'StrictHostKeychecking=no' /tmp/rsync/file.txt user@domain:/tmp/rsync/ # rsync -arvce ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no /tmp/rsync/file.txt user@domain:/tmp/rsync/
I still get prompted to validate the target server's key. I understand the -o StrictHostKeychecking=no options let me choose whether to bypass that step each time I open a connection.
Am I doing it incorrectly?
here' some links I've read about this:
http://linuxcommando.blogspot.com/2008/10/how-to-disable-ssh-host-key-checking.html
http://www.thegeekstuff.com/2010/04/how-to-fix-offending-key-in-sshknown_hosts-file/
http://www.cyberciti.biz/faq/linux-appleosx-howto-disable-ssh-host-key-checking/
You should delete the key causing the “Warning: Remote host identification has changed” error, then save your changes. You might also want to delete the entire known_hosts file, especially if you only use SSH for one or two sites. To do this, you can run rm . ssh/known_hosts in a Terminal window.
Disable with SSH Command You can define the StrictHostKeyChecking=no command line argument to ssh command to skip the host key checking.
The strict-host-key-checking command specifies how host keys are checked during the connection and authentication phase. By default, strict host key checking is disabled. When disabled the SSH client verifies the incoming host key against the keys in the known hosts list.
I've resolved it.
Here's the correct (or mostly correct) way to add that option:
# rsync -e "ssh -o StrictHostKeyChecking=no" -arvc /tmp/rsync/file.txt user@domain:/tmp/rsync/
Appears there's a finicky way to apply the option, by adding double quotes and placing the ssh inside.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With