Git: Permission denied (publickey) fatal - Could not read from remote repository. while cloning Git repository

后端 未结 30 1819
青春惊慌失措
青春惊慌失措 2020-12-12 10:10

I am unable to clone a Git repository, and getting this error:

krishna.soni@KRISHNACHANDRAS /c/Projects $ git clone http://stage.abc.com:10088/pqr
http://<         


        
相关标签:
30条回答
  • 2020-12-12 10:36

    If there is still issue around access after creating SSH and adding it in your Bitbucket account or wherever, you need to do the following in terminal on GitBash, OSX or Linux:

    # Lists already added identities (‘ssh keys’)
    ssh-add -l
    

    Then, if you don't see your key listed, add it with the following (replace identity with its real name):

    # Add a new identity
    ssh-add ~/.ssh/identity
    

    This worked for me.

    0 讨论(0)
  • 2020-12-12 10:37

    I faced the same issue while running git clone command from windows command line. But the command runs successfully from Git Bash.

    0 讨论(0)
  • 2020-12-12 10:38

    I had the same error. My solution was to logout and login again as my ssh-agent had become out of sync with the remote ssh key.

    Adding this here just in case anyone has seen that the other answers don't seem to apply to their situation.

    0 讨论(0)
  • 2020-12-12 10:40

    I was facing the same issue while setting up ssh for gitlab. I already have ssh for github and i could not overwrite that. The steps that worked for me are :

    1. Generate SSH with new path and add it to ssh list ssh-add /path/to/new/id_rsa.
    2. Create a file named config in ~/.ssh/ using. I used vi ~/.ssh/config/.
    3. Add this to the newly created file

    # GitLab.com server Host gitlab.com RSAAuthentication yes IdentityFile /path/to/new/id_rsa

    1. Save and quit.

    After that restart the terminal and try pushing, it should work

    0 讨论(0)
  • 2020-12-12 10:43

    It looks like a permissions issue - not a Windows 7 issue.

    Your ssh key is not authorised - Permission denied (publickey).

    You need to create a public ssh key and ask the administrator of the Git repository to add the ssh public key

    Information on how to do this: Saving ssh key fails

    0 讨论(0)
  • 2020-12-12 10:43

    If you generate new public ssh key and inserted it to bitbucket or github and

    it not helped - please try to restart your PC. It helped me!!

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