programming/Linux

SSH Key Clear

워아인이 2021. 7. 2. 13:12

[현상]

대체기 서버(28)에서 개발기 서버(75)로 federate 파일 디렉토리 copy하려다 발생한 오류

2021.07.02

 

[발생 Error Message1]
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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 - to get rid of this message.
Offending key in -
RSA host key for 28 has changed and you have requested strict checking.
Host key verification failed.

 

[발생 Error Message2]

The authenticity of host '28' can't be established.
RSA key fingerprint is 
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '28' (RSA) to the list of known hosts.

 

[해결]

RSA key가 맞지 않아서 key clear 시켜주어야함

ssh의 known_hosts 키와 파일을 삭제하면 해결

 

# cd .ssh

# rm -f known_hosts

: 공개키가 담긴 known_hosts 파일 삭제

 

# cd /etc/ssh

# ll

/etc/ssh 내 키

 

 

# rm -f /etc/ssh/ssh_host_*

: ssh_host_* 키 삭제

# /etc/init.d/sshd restart

: sshd 서버 재시작 -> 키 생성

 

그 후 다시 28서버에서 74서버로 디렉토리 카피하니 해결 완