SSH connection When prompted the authenticity of HOST XX CAN ' T be established

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.