Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Getting Error: You need access to git with ssh

I am getting error when I tried ssh for git.com.

Error: You need access to git with ssh

This was working fine until very recent.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

The reason is recently GitHub.com’s RSA SSH private key was briefly exposed in a public GitHub repository. So they have changed their RSA SSH host key used to secure Git operations for GitHub.com

You can verify whether this is the exact reason by running below command.

ssh -vT git@github.com

If you see following warning, above causes the issue.

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!

Run following commands to update the GitHub.com’s RSA SSH key in your machine

Step 1: Remove the old key by running this command:

ssh-keygen -R github.com 

Step 2: automatically update GitHub.com’s RSA SSH key in your ~/.ssh/known_hosts

curl -L https://api.github.com/meta | jq -r '.ssh_keys | .[]' | sed -e 's/^/github.com /' >> ~/.ssh/known_hosts

refer https://github.blog/2023-03-23-we-updated-our-rsa-ssh-host-key/

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading