Host key verification failed.

이전에 한번 접속했던 IP의 서버와 RSA 공유키를 교환 후, 같은 IP의 다른 서버로 변경되면 나오는 오류

해결방법 : $ ssh-keygen -R <IP>

$ ssh root@169.56.XX.X
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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:sbCzGJTQYHIirEbjs213y
Please contact your system administrator.
Add correct host key in /Users/hgmin777/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /Users/hgmin777/.ssh/known_hosts:5
RSA host key for 169.56.XX.X has changed and you have requested strict checking.
Host key verification failed.

$ ssh-keygen -R 169.56.XX.X
# Host 169.56.XX.X found: line 5
/Users/hgmin777/.ssh/known_hosts updated.
Original contents retained as /Users/hgmin777/.ssh/known_hosts.old

$ ssh root@169.56.XX.X
The authenticity of host ‘169.56.XX.X’ can’t be established.
RSA key fingerprint is SHA256:sbCzGJTQYHIirEbj
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘169.56.XX.X’ (RSA) to the list of known hosts.

[root@cloudz2 ~]# passwd
root 사용자의 비밀 번호 변경 중
새 암호:
새 암호 재입력:
passwd: 모든 인증 토큰이 성공적으로 업데이트 되었습니다.

--

--