October 03, 2021
최근 인프라 쪽 작업을 하면서 ec2 에 작업을 좀 하다가 키를 바꾸게 되었다.
그리고 다시 접근을 하는데 아래와 같은 에러가 발생하였다.
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 [접근할 주소]
shell > ssh-keygen -R [접근할 주소-ec2 주소 등]
...
[본인의 known_hosts 경로] updated.
Original contents retained as [본인의 known_hosts 경로]
...
위와 같은 출력이 뜬 뒤로 다시 해보면 잘 된다.