1、使用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 the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
ea:24:31:8d:03:07:36:db:2f:74:15:5d:58:67:a3:5b.
Please contact your system administrator.
Add correct host key in /var/root/.ssh/known_hosts to get rid of this message.
Offending key in /var/root/.ssh/known_hosts:1
RSA host key for 192.168.1.203 has changed and you have requested strict checking.
Host key verification failed.
2、原因
服务器的公钥(public key)发生了变化(比如重装了系统或重装了openssh服务),而客户端存储的信息没有发生变化
使用 OpenSSH 连接服务器会把你每个你访问过计算机的公钥(public key)都记录在 ~/.ssh/known_hosts 文件中。当下次访问相同计算机时,OpenSSH会核对公钥。如果公钥不同,OpenSSH会发出警告,避免你受到DNS Hijack之类的攻击。
3、解决方法
本地机器运行
ssh-keygen -R 远程服务器IP