几年来,我一直在使用 ssh 登录到我租用的远程服务器。上周我收到他们的消息,说他们升级了我的帐户和服务器。现在当我去登录时,我从 ssh 收到这条消息
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: POSSIBLE DNS SPOOFING DETECTED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
The RSA host key for mydomain.com has changed,
and the key for the corresponding IP address X.X.X.X
is unknown. This could either mean that
DNS SPOOFING is happening or the IP address for the host
and its host key have changed at the same time.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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 the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
XXxXXXXXXX
Please contact your system administrator.
Add correct host key in /home/myaccount/.ssh/known_hosts to get rid of this message.
Offending key in /home/myaccount/.ssh/known_hosts:7
RSA host key for mydomain.com has changed and you have requested strict checking.
Host key verification failed.
Run Code Online (Sandbox Code Playgroud)
现在,我假设这是由我的主机升级我的服务器触发的。所以我想再次信任这个网站。但我不太明白如何。
我查看了 known_hosts,所有的都是公钥。但我无法分辨其中哪些来自该特定服务器的旧版本。我也不知道如何为主机获取正确的密钥;上次我联系的时候,我想ssh刚刚跟我确认并自动保存了它。现在它说我已经要求严格检查,但我不知道我什么时候这样做或在哪里重置它。
dav*_*vey 10
线路:
Offending key in /home/myaccount/.ssh/known_hosts:7
Run Code Online (Sandbox Code Playgroud)
表示旧密钥位于 known_hosts 文件的第 7 行。使用您最喜欢的编辑器删除第 7 行。这应该使它消失。
您还可以使用 ssh-keygen -R 删除条目:
# ssh-keygen -R hostname -f ~/.ssh/known_hosts
Run Code Online (Sandbox Code Playgroud)
仅供参考,那些不是公钥,而是主机的散列表示。
您可以使用以下命令列出已知主机文件:
$ ssh-keygen -lv -f ~/.ssh/known_hosts
Run Code Online (Sandbox Code Playgroud)
然后它将显示密钥和 ascii 艺术表现形式:
2048 0f:3b:8a:02:75:f1:68:0f:32:8a:7a:0f:ef:69:f8:a0 |1|aa3F96t0nzhqLpt+lJx4msNAGQI=|740B4+NTrQhAx/DWXHf6QLrBpz8= (RSA)
+--[ RSA 2048]----+
| |
| . |
| = |
|o * . |
|o= o S |
|+ . + |
|..o. o . |
|..++.o . . |
|E. *B . |
+-----------------+
Run Code Online (Sandbox Code Playgroud)
理论上,您可以将其打印出来并将其保存在安全的地方。当发生可疑的事情时,您有一份副本以供参考。
我要补充一点,在听取我尊敬的服务器故障同事的建议并从您的 known_hosts 文件中删除该行之前,您应该与另一端的客户服务联系并确保他们确实做了一些会导致此密钥的事情改变。
归档时间: |
|
查看次数: |
11619 次 |
最近记录: |