How to solve Permission denied (publickey) error when using Git?

后端 未结 30 2474
野性不改
野性不改 2020-11-22 08:07

I\'m on Mac Snow Leopard and I just installed git.

I just tried

git clone git@thechaw.com:cakebook.git

but that gives

30条回答
  •  清歌不尽
    2020-11-22 08:12

    The github help link helped me sort out this problem. Looks like the ssh key was not added to the ssh-agent. This is what i ended up doing.

    Command 1:

    Ensure ssh-agent is enabled. The command starts the ssh-agent in the background:

    eval "$(ssh-agent -s)"
    

    Command 2:

    Add your SSH key to the ssh-agent:

    ssh-add ~/.ssh/id_rsa
    

提交回复
热议问题