잘 접속되던 서버가 아래와 같은 오류메세지가 뜨면서 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
-생략-
Please contact your system administrator.
Add correct host key in /home/warren/.ssh/known_hosts to get rid of this message.
Offending key in /home/warren/.ssh/known_hosts:1
RSA host key for -(ip)- has changed and you have requested strict checking.
Host key verification failed.
일단 ssh-keygen -R 명령어로 해결할 수 있다.
ssh-keygen -R [ 예시 IP: 188.188.18.1]
ssh-keygen -R 188.188.18.1
위와 같이 해결한 후 접속을 시도하면 맨처음 SSH 메시지로 바뀐다.
Are you sure you want to continue connecting (yes/no)?
yes 를 입력하면 SSH 접속이 정상적으로 이루어진다.
TIP : 이게 생기는 오류는 기존의 IP를 변경하거나 혹은 변경되었거나 하드웨어적 시스템에 따라 자동변경이 될 수도 있기 때문이다. 이러한 문제가 생기면 당황하지 말고, 위에 제시한 방법으로 해결할 수 있다.