我无法连接到我的 ssh 服务器。我尝试首次登录,但总是收到上述错误:
The authenticity of host '...' can't be established.
ECDSA key fingerprint is SHA256:.... Are you sure you want to continue connecting (yes/no/[fingerprint])?
Host key verification failed.
问题:known_host 文件不存在,因为这是我第一次连接。
我最终可以通过以下命令强制 ssh 不验证主机密钥来解决这个问题:
ssh -o StrictHostKeyChecking=No user@adress
然后,known_host
文件也生成了。
无论如何,我想知道为什么在此之前无法连接。正常情况下它应该可以工作,不是吗?这样解决这个问题是否存在安全风险?据我了解,ssh 现在永远不会验证此特定连接的主机密钥。
答案1
Are you sure you want to continue connecting (yes/no/[fingerprint])?
就我的情况而言,这是我第一次连接到我的服务器,我必须输入 yes 并按回车键,否则我会得到The authenticity of host '...' can't be established. ECDSA key fingerprint is SHA256:.... Are you sure you want to continue connecting (yes/no/[fingerprint])? Host key verification failed.
。