0

I understand this is due to the pub key change and followed the steps here to fix it: Why are connections to GitHub over SSH throwing an error "Warning: Remote Host Identification Has Changed"?

However, everytime I perform the git push command, this message re-appears and I have to update my known_hosts file again.

Anyone else ran into this issue?

  • Try `ssh-keygen -R github.com && ssh-keygen -R 140.82.113.4 && ssh-keygen -R 140.82.113.3 && ssh-keyscan github.com >> ~/.ssh/known_hosts` See https://stackoverflow.com/q/76187211/7976758 – phd Jul 03 '23 at 14:32
  • Already did that and it works fine with pull. The problem is when I push changes. Then I get this error again on both push and pull. I can confirm it with "yes" in the console, but it takes an extra step. – Elena Ivanova Jul 03 '23 at 15:15
  • Edit `known_hosts`. Find the entries for GitHub and remove those lines. – John Hanley Jul 03 '23 at 19:53
  • @phd - the details about `known_hosts` are not part of the post. Details matter to get good answers. You are assuming that `known_hosts` is hashed. I am assuming it is not. The question should be updated so that we are not assuming anything. – John Hanley Jul 03 '23 at 21:01
  • Not hashed and already tried that - as mentioned in the description, the issue gets fixed until I run git push specifically. – Elena Ivanova Jul 03 '23 at 22:32
  • Diff the before and after changes to known_hosts. That might provide a clue. Add those details to your post. – John Hanley Jul 03 '23 at 22:34

1 Answers1

0

It looks like there were some additional entries with the same IP and key from github in my known_hosts file. I had to remove all of them manually.

github.com,192.30.252.130 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==
140.82.114.4 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==
140.82.112.3 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==

Then ran the command to add a valid key

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

That fixed the issue for me.