After update from GitHub "We updated our RSA SSH host key" all my build's are failing in CircleCI

1k Views Asked by At

GitHub posted this article today 24.03.2023 but based on this can someone help me with CircleCI, I think because of this all my builds are failing and I get this message when CircleCI tried to install dependencies:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@       WARNING: POSSIBLE DNS SPOOFING DETECTED!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
The RSA host key for github.com has changed,
and the key for the corresponding IP address 140.82.114.3
is unknown. This could either mean that
DNS SPOOFING is happening or the IP address for the host
and its host key have changed at the same time.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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:uNiVztksCsDhcc0u9e8BujQXVUpKZIDTMczCvj3tD2s.
Please contact your system administrator.
Add correct host key in /home/circleci/.ssh/known_hosts to get rid of this message.
Offending RSA key in /home/circleci/.ssh/known_hosts:1
  remove with:
  ssh-keygen -f "/home/circleci/.ssh/known_hosts" -R "github.com"
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.
3

There are 3 best solutions below

0
MAhipal Singh On

on 23-03-2023 GitHub update RSA keys , Follow below command update.

https://github.blog/2023-03-23-we-updated-our-rsa-ssh-host-key/

steps for mac users

  1. ssh-keygen -R github.com
  2. Install JQ (optional: if you get jq not found than run this cmd) brew install jq
  3. curl -L https://api.github.com/meta | jq -r '.ssh_keys | .[]' | sed -e 's/^/github.com /' >> ~/.ssh/known_hosts
1
spyrox On

my solution is by upgrading git-shallow-clone to latest version @2.5.0

1
aGez On

Just run command:

ssh-keyscan -H github.com > ~/.ssh/known_hosts