1

I have followed the following steps to create and add a SSH key and deleted all the previously created keys in the folder ~/.ssh/

  • $ ssh-keygen -t rsa -b 4096 -C "myEmail@gmail.com"
  • $ eval "$(ssh-agent -s)"
  • $ ssh-add -K ~/.ssh/id_rsa
  • $ clip < ~/.ssh/id_rsa.pub and then added the content in Git

Then I try:

  • $ git push -u origin master

and I get:

The authenticity of host 'github.com (140.82.121.4)' can't be established. ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU. This key is not known by any other names. Are you sure you want to continue connecting (yes/no/[fingerprint])?

(That key is one of the previous I had created and deleted)

What can I do to overcome this issue?

  • https://stackoverflow.com/a/13364116/7976758 – phd Feb 26 '22 at 13:59
  • For me I was cloning a repo and this error occured to me. Turns out, I just forgot to add my ssh key to ssh-agent: https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent – Blackraspberryyy May 10 '23 at 08:29
  • The following answer described how to add the entry to known_hosts safely: https://serverfault.com/a/701637 Then, github.com will be recognized and the user won't be promted. – Ladislav Ondris Jun 29 '23 at 11:58

1 Answers1

7

The authenticity of host 'github.com (140.82.121.4)' can't be established. ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU. This key is not known by any other names. Are you sure you want to continue connecting (yes/no/[fingerprint])?

This message has nothing to do with the key that you created. The SSH server that you connected to starts by identifying itself to your ssh client, and this message means that your client doesn't recognize the server that it connected to. You'll get a message like this the first time you connect to any SSH server.

You would generally reply to this by typing "yes" and pressing [enter], unless you have a particular reason to believe something funny is going on.

Kenster
  • 23,465
  • 21
  • 80
  • 106