Skip to content

Instantly share code, notes, and snippets.

@vikpe
Last active March 23, 2026 03:03
Show Gist options
  • Select an option

  • Save vikpe/34454d69fe03a9617f2b009cc3ba200b to your computer and use it in GitHub Desktop.

Select an option

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
@RaRdEvA
Copy link
Copy Markdown

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
Copy Markdown

It worked!!! Thanks 💙

@jul-k
Copy link
Copy Markdown

jul-k commented Apr 13, 2024

that worked for me! thank you ❤️

@Dimas-Prasetya
Copy link
Copy Markdown

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.

Read line by line, and you will get the light.
Thank you 👍

@yusufatw
Copy link
Copy Markdown

yusufatw commented Jun 7, 2024

thank you it worked!

@arieldc
Copy link
Copy Markdown

arieldc commented Sep 21, 2024

Thanks!!!

@diorcula
Copy link
Copy Markdown

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 worked for me, note that it automatically added 'github.com' to the list of known hosts

@Xaidor
Copy link
Copy Markdown

Xaidor commented Jan 14, 2025

Omg Thanks a bunch!

@WazzyJaymz
Copy link
Copy Markdown

Thnaks it worked!

@rindev0901
Copy link
Copy Markdown

thanks it work well

@Rekidiang2
Copy link
Copy Markdown

it work thank you

@techsin
Copy link
Copy Markdown

techsin commented Jul 19, 2025

worked thanks

@z-purr
Copy link
Copy Markdown

z-purr commented Oct 15, 2025

$ ssh-keyscan github.com >> ~/.ssh/known_hosts
bash: /c/Users/cheng/.ssh/known_hosts: No such file or directory

that is not working on my side

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