permission denied (publickey) Error using git on windows 7

后端 未结 15 1937
暖寄归人
暖寄归人 2021-01-29 22:35

When I want to push to github with this command

git push origin master

I got this

Permission denied (publickey).
fatal: The rem         


        
相关标签:
15条回答
  • 2021-01-29 23:03

    The problem may be related to the order in which the ssh.exe are in the PATH environmental variable.

    In my case there was a ssh.exe in both the C:\Program Files(x86)\git and also in my C:\cwgwin directory. When I was in my Git Bash everything worked fine (it was using the ssh in the git directory) but when I was in my Command Prompt it was using the ssh in my cygwin directory.

    When I tried to access github it was not able to find the .ssh folder with my private key because the key was not attached to the ssh the command prompt was using (ie the C:\cygwin one) and that is why I was getting the Permission Denied error.

    What I did was rename (or delete) the git.exe and ssh.exe in my C:\cygwin directory and make sure that C:\Program Files(x86)\git appears before the C:\cwgwin in the PATH order.

    0 讨论(0)
  • 2021-01-29 23:08

    I had similar Prob in win 8.

    Very Simple mistake I did: I have already created public key in git hub account so that y keys was not getting match.

    Solution:

    • delete ssh folder and key from github account and do it again the process

    1) ssh-keygen -t rsa -C "your mail address"

    2) ssh -T git@github.com

    0 讨论(0)
  • 2021-01-29 23:09

    there could be something wrong with your heroku keys. try:

    heroku keys:add
    

    similar question here: Heroku Git - fatal: The remote end hung up unexpectedly

    0 讨论(0)
提交回复
热议问题