git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Slightly embarassing bug in error message when RSA key doesn't match.

From
PSPeter da Silva <resuna@gmail.com>
Date
Jan 25, 2024, 16:37 UTC
Message-ID
<CAMbH6s90tNo1Kz3xuv741LoUkN=Y3Bcw2=7yGQhEe=xrgBgQcw@mail.gmail.com>
git version 2.20.1

I just went to clone a repo on github on a dev server that I hadn't used since March 1 2023.

Github updated their RSA key on March 24th.
So I got this message.
Warning: the ECDSA host key for 'github.com' differs from the key for
the IP address '140.82.113.3'
Offending key for IP in /[...]/.ssh/known_hosts:8
Matching host key in /[...]/.ssh/known_hosts:18

Of course it was the RSA key that had changed, and known_hosts:8 was an RSA key, but the error said the ECDSA key was wrong. After removing the bogus RSA key from the file it worked fine with the matching ECDSA key. This error should probably report the correct type for the key that is wrong rather than the key it’s trying to use. :)

Next: Jeff King
Message 1 of 2 in “Slightly embarassing bug in error message when RSA key doesn't match.”
  1. Peter da SilvaJan 25, 2024
  2. Jeff KingJan 25, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.