Thursday, February 12, 2009

ssh登陆时出错

例子如下:

当我ssh到某一台机器时, ssh会出现下面这种情况:

jessinio@jessinio-desktop:~$ ssh inter0
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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 DSA host key has just been changed.
The fingerprint for the DSA key sent by the remote host is
46:3c:fc:26:78:b7:e8:a2:4c:e4:ab:c5:65:11:43:e0.
Please contact your system administrator.
Add correct host key in /home/jessinio/.ssh/known_hosts to get rid of this message.
Offending key in /home/jessinio/.ssh/known_hosts:52
DSA host key for inter0 has changed and you have requested strict checking.
Host key verification failed.

这种事常常会发生,特别是SA.
平时我的解决方法是rm ~/.ssh/known_hosts

不过, 这样有个问题:以前登陆过的机器在ssh登陆时,都会出现:
Are you sure you want to continue connecting (yes/no)?

有点烦!

今天细看了一下上面的ssh抛出的信息(平时我都没有细看过 囧!! ):
Offending key in /home/jessinio/.ssh/known_hosts:52

结果把~/.ssh/known_hosts的第52行delete后, 一切OK

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.