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

Unable to connect Github ssh after restart

I try setup my Github Ssh key by follow step from https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account. At first everything works OK.

But after restart my computer, using git repository gives error : Error: Permission denied (publickey).

I create a new Github repository run git clone, but it still return the same error.

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 :

Seems a duplicate of Git: How to solve Permission denied (publickey) error when using Git?

  • Ensure the ssh-agent is running by running eval $(ssh-agent -s)
  • Add the key by running ssh-add ~/.ssh/{key_name} where key_name is your key file name you generated (example: id_ed25519)
  • You may want to consider creating or appending below to .ssh/config
Host github.com
   HostName github.com
   PreferredAuthentications publickey
   IdentityFile ~/.ssh/{key_name}
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