작성일InOS
,
UbuntuDisqus: Symbols count in article: 851Reading time ≈1 mins.
RSA 키 충돌 문제 (REMOTE HOST IDENTIFICATION HAS CHANGED)
최근 인프라 쪽 작업을 하면서 ec2 에 작업을 좀 하다가 키를 바꾸게 되었다. 그리고 다시 접근을 하는데 아래와 같은 에러가 발생하였다.
1 2 3 4 5 6 7 8 9 10 11 12 13 14
shell > ssh -i "test.pem" 192.168.0.1
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ 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 ECDSA key sent by the remote host is SHA256:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Please contact your system administrator. Add correct host key in [자신의 known_hosts 경로] to get rid of this message. .....
이럴 경우 다시 키를 생성해서 처리해주면 된다.
ssh-keygen -R [접근할 주소]
1 2 3 4 5
shell > ssh-keygen -R [접근할 주소-ec2 주소 등] ... [본인의 known_hosts 경로] updated. Original contents retained as [본인의 known_hosts 경로] ...