반응형

윈도우의 CMD창을 통해 SSH접속을 하여 사용하다가 서버의 SHA256 해시 값이 변경되어 접속이 되지 않는 경우가 발생하면서 다음과 같은 메시지가 나온다.

C:\Users\naugi>ssh id@172.xxx.xxx.xxx
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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:nikywW32kmocgzauE4xBs3MLgwALjLNGRc2e+GWUybU.
Please contact your system administrator.
Add correct host key in C:\\Users\\naugi/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in C:\\Users\\naugi/.ssh/known_hosts:1
ECDSA host key for 172.xxx.xxx.xxx has changed and you have requested strict checking.
Host key verification failed.

이경우 다음과 같이 해시를 갱신하면 접속이 가능하다.

ssh-keygen -R [IP주소]

C:\Users\naugi>ssh-keygen -R 172.xxx.xxx.xxx
# Host 172.xxx.xxx.xxx found: line 1
C:\Users\naugi/.ssh/known_hosts updated.
Original contents retained as C:\Users\naugi/.ssh/known_hosts.old

명령 수행 후 처음 접속하면 다음과 같은 메시지가 나온다. 이때 'yes'를 입력하면 접속이 가능해 진다.

C:\Users\naugi>ssh id@172.xxx.xxx.xxx
The authenticity of host '172.xxx.xxx.xxx (172.xxx.xxx.xxx)' can't be established.
ECDSA key fingerprint is SHA256:nikywW32kmocgzauE4xBs3MLgwALjLNGRc2e+GWUybU.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '172.xxx.xxx.xxx' (ECDSA) to the list of known hosts.
id@172.xxx.xxx.xxx's password:
반응형
블로그 이미지

DeveloperN

개발자 n의 개발 이야기(draft)

,