SSH Link Cloud Host:
SSH [email protected]
Error: The authenticity of HOST XX CAN ' T be established
Workaround:
Ssh-o stricthostkeychecking=no [email protected]
Enter password, link successful
Same as host key verification failed in SSH.
Many of the solutions on the Web are: VI ~/.ssh/known_hosts delete the rows associated with the host you want to connect to, or delete the file directly known_hosts. Of course, this scheme is feasible, but it is not the fundamental solution to the problem, because it will continue to be used, and it may have to be deleted again in the future.
The following is a brief discussion of the principle of this problem and the longer-term solution.
Anyone with OpenSSH knows that SSH will record every public key you have accessed your computer in ~/.ssh/known_hosts. The next time you access the same computer, OpenSSH checks the public key. If the public key is different, OpenSSH warns you against attacks such as DNS hijack. The
SSH check level for the host's Public_key is configured according to the stricthostkeychecking variable. By default, the
stricthostkeychecking=ask. Simply put down its three configuration values:
1.
stricthostkeychecking=no
#最不安全的级别, of course, there are not so many annoying hints, the relatively secure intranet test is recommended. If the connection server key does not exist locally, it is automatically added to the file (default is Known_ Hosts), and gives a warning.
2.
stricthostkeychecking=ask #默认的级别, that is, the prompt has just appeared. If the connection and key do not match, give a hint and deny login.
3.
stricthostkeychecking=yes #
The most secure level, if the connection does not match the key, the connection is rejected and the details are not prompted.
For me, some tests conducted in the intranet, for convenience, choose the lowest level of security. Configured in. ssh/config (or/etc/ssh/ssh_config):
Stricthostkeychecking No Userknownhostsfile/dev/null |
(Note: Here for the sake of simplicity, the knownhostfile is set to/dev/null, it is not guaranteed to exist in the known_hosts)
Reference: http://smilejay.com/2012/12/ssh-config-host-key-checking/
SSH connection When prompted the authenticity of HOST XX CAN ' T be established