Skip to content

Instantly share code, notes, and snippets.

@vikpe
Last active May 2, 2024 16:22
Show Gist options
  • Star 66 You must be signed in to star a gist
  • Fork 13 You must be signed in to fork a gist
  • Save vikpe/34454d69fe03a9617f2b009cc3ba200b to your computer and use it in GitHub Desktop.
Save vikpe/34454d69fe03a9617f2b009cc3ba200b to your computer and use it in GitHub Desktop.
FIX: The authenticity of host github.com can't be established.

Error

The authenticity of host 'github.com (140.82.113.4)' can't be established.

Fix

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

Example (eg. using CircleCI workflow)

- run:
    name: Add github.com to known hosts
    command: ssh-keyscan github.com >> ~/.ssh/known_hosts
@joestar-dev
Copy link

Thanks

@JacobCampa
Copy link

Thank you for the help, it fixed my problem :)

Copy link

ghost commented Jul 18, 2023

The authenticity of host 'github.com (140.82.114.3)' 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])?

alguien sabe como puedo solucionar ese error ? le doy que yes que deseo continuar y sale lo msimo
intente hacer los pasos de arriba pero no funciono nose que hice mal

@Ahmadnoorkhan1
Copy link

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])? yes Warning: Permanently added 'github.com' (ED25519) to the list of known hosts. git@github.com: Permission denied (publickey).
Im getting the same issue
Firstly I couldn't add rsa format ssh in the deploy keys, warning was thrown to add an openssh format
after creating an ssh with ED25519 format github didn't threw an error but on my linux machine I'm getting this error

@surajyadav9
Copy link

Thanks a bunch!!!

@Bouhmid-codes
Copy link

Thanks!!!

@noeGnh
Copy link

noeGnh commented Sep 14, 2023

Thanks !

@KaoriRachel
Copy link

Thanks!

@tomigee
Copy link

tomigee commented Sep 21, 2023

User beware: doing this method above leaves you vulnerable to man-in-the-middle attacks. Instead, I'd recommend following GitHub's documentation on Testing your SSH connection. Pay special attention to the step where they ask you to compare the fingerprint returned in command line with GitHub's public fingerprint.

@ariel-frischer
Copy link

Worked for me on WSL

@Sam-Wisdoms
Copy link

How can I check if it worked please?
I got the below output after entering the command.

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

github.com:22 SSH-2.0-babeld-dd067d10

github.com:22 SSH-2.0-babeld-dd067d10

github.com:22 SSH-2.0-babeld-dd067d10

github.com:22 SSH-2.0-babeld-dc5ec9be

github.com:22 SSH-2.0-babeld-dd067d10

what I'm I supposed to do to check if it worked?

@mustict
Copy link

mustict commented Oct 11, 2023

thanks . it worked for me

@tklives
Copy link

tklives commented Oct 26, 2023

User beware: doing this method above leaves you vulnerable to man-in-the-middle attacks. Instead, I'd recommend following GitHub's documentation on Testing your SSH connection. Pay special attention to the step where they ask you to compare the fingerprint returned in command line with GitHub's public fingerprint.

THIS IS THE WAY.

Best part is that this is a one time step, and once you've verified for yourself and type 'yes' it automagically adds github.com to known_hosts for you.

Going through the (one/single) extra step of manually verifying that the SHA listed in the terminal's warning message matches what is listed on GitHub's public fingerprint page is very simple and secure.

Cheers @tomigee!! 🏆 🎉

@knarewski
Copy link

GitHub now exposes the ssh keys via API: https://api.github.com/meta , allowing the safer way of automating the process

https://serverfault.com/a/1098531/1058191

@sarkatesiddhant
Copy link

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])? yes Warning: Permanently added 'github.com' (ED25519) to the list of known hosts. git@github.com: Permission denied (publickey). Im getting the same issue Firstly I couldn't add rsa format ssh in the deploy keys, warning was thrown to add an openssh format after creating an ssh with ED25519 format github didn't threw an error but on my linux machine I'm getting this error

I am also getting the same type of error.

@TSB1999
Copy link

TSB1999 commented Nov 3, 2023

Thanks

@ashraf-minhaj
Copy link

Thanks

@alx8437
Copy link

alx8437 commented Nov 13, 2023

Thank you!

@Berlou33
Copy link

Thanks

@Zeliha64
Copy link

Thanks

@Zied-bousnina
Copy link

thanks

@animesh-singhal
Copy link

Thanks!

@sahar-Nosrati
Copy link

Thanks a lot

@Rene314159
Copy link

Testing your SSH connection

thanks for your comment, it was very helpful to me

@iwan-uschka
Copy link

thanks @tomigee

@qianpeng2
Copy link

How can I check if it worked please? I got the below output after entering the command.

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

github.com:22 SSH-2.0-babeld-dd067d10

github.com:22 SSH-2.0-babeld-dd067d10

github.com:22 SSH-2.0-babeld-dd067d10

github.com:22 SSH-2.0-babeld-dc5ec9be

github.com:22 SSH-2.0-babeld-dd067d10

what I'm I supposed to do to check if it worked?

open file known_hosts,then copy fingerprint to tortoisegit input box,then input yes, and you will be able to pull code

@bymunajat
Copy link

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])? yes Warning: Permanently added 'github.com' (ED25519) to the list of known hosts. git@github.com: Permission denied (publickey). Im getting the same issue Firstly I couldn't add rsa format ssh in the deploy keys, warning was thrown to add an openssh format after creating an ssh with ED25519 format github didn't threw an error but on my linux machine I'm getting this error

problem like me right now

@RaRdEvA
Copy link

RaRdEvA commented Mar 23, 2024

User beware: doing this method above leaves you vulnerable to man-in-the-middle attacks. Instead, I'd recommend following GitHub's documentation on Testing your SSH connection. Pay special attention to the step where they ask you to compare the fingerprint returned in command line with GitHub's public fingerprint.

Follow this instructions it is the right process

@spxctr00m
Copy link

It worked!!! Thanks 💙

@jul-k
Copy link

jul-k commented Apr 13, 2024

that worked for me! thank you ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment