운영체제/리눅스

[리눅스]SSH KNOWN_HOSTS (ECDSA HOST KEY) 가 다르다고 나올 때 해결 방법

Cloud_Park 2022. 11. 9. 18:18

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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 ED25519 key sent by the remote host is
SHA256:AJgsnOQc.
Please contact your system administrator.
Add correct host key in ~/.ssh/known_hosts to get rid of this message.


Offending ED25519 key in ~/.ssh/known_hosts:90

원인 :  해당 서버에  known_hosts가 다름 

방법 : 해당 디렉토리의 90번 줄을 삭제 또는 ssh-keygen -R [IP]        명령어

 
Host key for [IP] has changed and you have requested strict checking.
Host key verification failed.

 


방법❯ ssh-keygen -R [IP]                                  

 


# Host [IP] found: line 90
~/.ssh/known_hosts updated.
Original contents retained as ~/.ssh/known_hosts.old

 

 

 

다시 시도

❯ ssh -i beomsookey.cer ubuntu@[IP]                     
The authenticity of host '[IP] ([IP] )' can't be established.
ED25519 key fingerprint is SHA256:Ayrv6/qZ5/B604heHWHmxCJgsnOQc.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '[IP] ' (ED25519) to the list of known hosts.
Welcome to Ubuntu 18.04.6 LTS (GNU/Linux 4.15.0-163-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage
New release '20.04.5 LTS' available.
Run 'do-release-upgrade' to upgrade to it.

Last login: Wed Nov  9 18:08:18 2022 from 103.243.200.17

 

 

결론 리눅스 윈도우 둘다해당

ssh-keygen -R [IP]