But before I did the backup system recovery exercise, I found that my rsync had been a long time without sync success. I used to use the key exchange to complete the authentication in SSH, but may be due to changes in the host key, each SSH connection (or rsync) will be prompted: the authenticity of host * * can ' t be established, need to output a The interaction of "yes".
For this hint, my script was not predictable at first, so there was no judgment and processing (it was easy to handle with expect), so I decided to remove the hint (about the host's check).
1. When using SSH to connect to a remote host, add the option "-O Stricthostkeychecking=no" as follows:
Ssh-o Stricthostkeychecking=no 192.168.xxx.xxx
2. One way to completely remove this hint is to modify the configuration in the/etc/ssh/ssh_config file (or $home/.ssh/config) and add the following two lines of configuration:
Stricthostkeychecking No
Userknownhostsfile/dev/null
After modifying the configuration, restart the sshd service, the command is:/etc/init.d/sshd restart (or service sshd restart)
Of course, this is the intranet in the very trust between the server SSH connection, so do not consider security issues, directly removed the master key (host key) check.
"Host Key verification failed encountered in SSH." Problem is also related to the "stricthostkeychecking" configuration.
In addition, you do not need a username and password, but use SSH key authentication to achieve the Linux system ssh between the landing, you can refer to: Linux How to configure the dual-computer SSH trust and then two-way password-free landing