SSHing git@github.com shows wrong/old SSH key

git, github, ssh, ssh-keys

Solution

I think you should edit your `<USER>/.ssh/config` file (or create it) with

Host github.com
User <USER>
IdentityFile ~/.ssh/github_rsa

Host *
User <USER>
IdentityFile ~/.ssh/id_rsa

and that would do the trick if what happens is what you're saying.

But maybe it is not a problem, as Step 5: Test everything out of your link says that you may see this warning:

# The authenticity of host 'github.com (207.97.227.239)' can't be established.
# RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
# Are you sure you want to continue connecting (yes/no)?

and you shouldn't worry, this is supposed to happen. Just verify that the fingerprint matches the one here and type "yes".

Problem

k, so I was setting up Git and followed this tutorial to set up an SSH key. The fingerprint was `16:27:...:a6:48`. I installed the GitHub client for Windows which set up a new SSH key automatically called `github_rsa` in the `%user%/.ssh/` folder. I deleted the "old" SSH key (don't ask me why) and set up a new one with the fingerprint `a6:17:ed:4a:1d:9a:c7:63:6a:a1:38:8b:96:e3:91:bf` I had simply deleted the previous `id_rsa` keys and the `known_hosts` file and then used `ssh-keygen` to make another - I didn't mess with the GitHub key). Now, whenever I try to ssh into `git@github`, it says: The authentication of host 'github.com (207.97.227.239)' can't be estabilished RSA key fingerprint is 16:27:...:a6:48 Are you sure you want to continue connecting (yes/no)? which is NOT what I want. It's showing the old SSH key which I'd deleted (along with `known_hosts`). What do I do? [Edit]: I was (wrongly) assuming that the fingerprint from the output of the terminal would match the fingerprint of my Public RSA key. I still have an issue with the SSH, but it's not related to this (the question has already been asked, read: Git push requires username and password). I'd delete this question, but it doesn't allow me to, saying "It has 1 or more answers. Please flag it for moderator attention." _even though its mine. Read more at: https://meta.stackexchange.com/questions/140646/what-should-i-do-if-i-realize-the-premise-of-a-question-was-faulty-but-i-alread/140676#140676

Original source

Related problems