远程主机识别已更改

使用 ssh 的常见错误是看错误

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
SHA256:L5ri/Xdgpuals893ej1z5F1wlg1n2YNeBf/tsABX+QQ.
Please contact your system administrator.
Add correct host key in /Users/username/.ssh/known_hosts to get rid of this message.
Offending RSA key in /Users/username/.ssh/known_hosts:12
RSA host key for *IP address* has changed and you have requested strict checking.
Host key verification failed.

这意味着你之前连接到同一服务器并使用不同的主机密钥进行识别。如果你知道你更改了服务器密钥,重新安装服务器或服务器管理员声明了一些更改,通常可以删除旧密钥并让 ssh 存储其新密码。

可以使用 ssh-keygen 透明地删除旧密钥:

ssh-keygen -R *IP address*

下一个连接应该要求你验证新指纹:

ssh192.168.0.128
The authenticity of host '192.168.0.128 (192.168.0.128)' can't be established.
ECDSA key fingerprint is SHA256:L5ri/Xdgpuals893ej1z5F1wlg1n2YNeBf/tsABX+QQ.
Are you sure you want to continue connecting (yes/no)? 

如果你不知道上述任何一项,最好是联系你的服务器管理员以确保一切正常。如果没有,潜在的攻击者将能够获得你的身份验证信息和所有传输的数据!