본문으로 건너뛰기

"rsa-ssh" 태그로 연결된 1개 게시물개의 게시물이 있습니다.

모든 태그 보기

· 약 2분
git push origin main

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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 RSA key sent by the remote host is
SHA256:~
Please contact your system administrator.

Add correct host key in /Users/niege/.ssh/known_hosts to get rid of this message.
Offending RSA key in /Users/niege/.ssh/known_hosts:2

RSA host key for github.com has changed and you have requested strict checking.
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
  1. 이전 키를 제거한다.
ssh-keygen -R github.com
터미널
ssh-keygen -R github.com
# Host github.com found: line 2
/Users/niege/.ssh/known_hosts updated.
Original contents retained as /Users/niege/.ssh/known_hosts.old
  1. 새 RSA SSH 공개키 항목을 추가한다.
ssh-keygen -R github.com
curl -L https://api.github.com/meta | jq -r '.ssh_keys | .[]' | sed -e 's/^/github.com /' >> ~/.ssh/known_hosts

이때 'zsh: command not found: jq' 라고 뜬다면, jq를 따로 설치해주어야 한다.

brew install jq
  1. 다시 푸시해본다.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Are you sure you want to continue connecting (yes/no)? yes
  1. Warning이 발생한다면 Warning: the ECDSA host key for 'github.com' differs from the key for the IP address '00.200.000.000'

해당 아이피로 다시 명령어를 입력해준다.

ssh-keygen -R 20.200.245.247
# Host 20.200.245.247 found: line 12
/Users/niege/.ssh/known_hosts updated.
Original contents retained as /Users/niege/.ssh/known_hosts.old

참조

RSA SSH 호스트 키를 업데이트했습니다.