Sshing git @ github.com shows wrong / old ssh key

k, so I configured Git and followed this tutorial to configure the SSH key. The imprint was 16:27:...:a6:48 . I installed the GitHub client for Windows , which configured a new SSH key, which is automatically called by github_rsa in the %user%/.ssh/ github_rsa / folder.

I deleted the โ€œoldโ€ SSH key (donโ€™t ask me why) and set up a new one using a6:17:ed:4a:1d:9a:c7:63:6a:a1:38:8b:96:e3:91:bf fingerprint a6:17:ed:4a:1d:9a:c7:63:6a:a1:38:8b:96:e3:91:bf I just deleted the previous id_rsa keys and the id_rsa file, and then used ssh-keygen to do something else - I didn't bother with the GitHub key).

Now when I try ssh in git@github , it says:

The host authentication 'github.com (207.97.227.239)' cannot be set. RSA key fingerprint - 16:27: ...: a6: 48 Do you really want to continue the connection (yes / no)?

which is NOT what I want. It shows the old SSH key that I deleted (along with known_hosts ). What should I do?

[Edit]: I was (mistakenly) assuming that the fingerprint from the terminal output would match the fingerprint of my RSA public key. I still have a problem with SSH, but it is not related to this (a question has already been asked, read: Git push requires username and password ). I would delete this question, but this does not allow me to say: "He has 1 or more answers. Please mark this for the attention of the moderator." Even despite its prey. 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

+4
source share
2 answers

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

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

and it will be a trick if what you say happens.

But maybe this is not a problem, since step 5: check everything on your link so that you can 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 should not worry, this should happen. Just make sure the fingerprint matches the name and enter yes.

+14
source

Since you deleted your known_hosts file, ssh-agent will provide this warning:

The host authentication 'github.com (207.97.227.239)' cannot be set by RSA key fingerprint 16:27: ...: a6: 48 Are you sure you want to continue the connection (yes / no)?

the first time he tries to connect to this host, as well as to any other hosts that you are connected to. For each new host, you say yes, the host fingerprint is added to the known_hosts file.

If you get a warning every time, then you have a big problem when your known_hosts file is not being written to ssh or not being read. You can check if this warning is provided to you with every SSH on a different machine.

Further reading

+1
source

All Articles