GitHub Error Message - Permission denied (publickey)

后端 未结 30 2570
长发绾君心
长发绾君心 2020-11-22 04:23

Anybody seen this error and know what to do?

I\'m using the terminal, I\'m in the root, the GitHub repository exists and I don\'t know what to do now.



        
30条回答
  •  日久生厌
    2020-11-22 05:22

    First, we need to check for existing ssh keys on your computer. Open up Terminal and run:

    ls -al ~/.ssh
    
    #or
    
    cd ~/.ssh
    ls
    

    and that will lists the files in your .ssh directory

    And finally depending on what you see (in my case was):

     github_rsa  github_rsa.pub known_hosts
    

    Just try setting up your RSA and hopefully that will solve your "git push origin" issues

    $ ssh-keygen -lf ~/.ssh/github_rsa.pub

    NOTE: RSA certificates are keys-paired so you will have a private and a public certificate, private will not be accessible for you since it belongs to github (in this case) but the public is the one you might be missing when this error happens (at least that was my case, my github account or repo got messed up somehow and i had to "link" the public key, previously generated)

提交回复
热议问题