안녕하세요. 송기석입니다.


요즘 회사 이전으로 이것 저것 정리하느라 바쁩니다.

오늘은 갑자기 WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! 메시지를 보게 되어 이것을 해결한 방법을 올립니다.


다음과 같이 접속을 시도 하니 문제가 발생하였습니다.


# ssh falinux@192.168.1.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

17:9d:90:ef:42:4f:46:1e:42:5c:ec:78:7d:dd:38:22.

Please contact your system administrator.

Add correct host key in /home/ksskor/.ssh/known_hosts to get rid of this message.

Offending ECDSA key in /home/ksskor/.ssh/known_hosts:42

  remove with: ssh-keygen -f "/home/ksskor/.ssh/known_hosts" -R 192.168.1.1

ECDSA host key for 192.168.1.1 has changed and you have requested strict checking.

Host key verification failed.


발생한 문제를 다음과 같은 방법으로 해결했습니다.
ssh-keygen -R [문제가 되는 IP] 를 입력해 주면 문제가 해결 됩니다.

# ssh-keygen -R 192.168.1.1

# Host 192.168.1.1 found: line 42 type ECDSA
/home/ksskor/.ssh/known_hosts updated.
Original contents retained as /home/ksskor/.ssh/known_hosts.old

다시 접속을 시도하면 다음과 같이 처음 접속을 하는 것처럼 나옵니다.

# ssh falinux@192.168.1.1

The authenticity of host '192.168.1.1 (192.168.1.1)' can't be established.
ECDSA key fingerprint is 17:9d:90:ef:42:4f:46:1e:42:5c:ec:78:7d:dd:38:22.
Are you sure you want to continue connecting (yes/no)? yes

yes를 선택하면 다음과 같이 접속을 할 수 있습니다.

Warning: Permanently added '192.168.1.1' (ECDSA) to the list of known hosts.
falinux@192.168.1.1's password:

감사합니다.