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

后端 未结 30 1795
野性不改
野性不改 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:36

    In MAC, go to Terminal

    1) Navigate to Home Directory using command - cd ~

    2) cd .ssh && ssh-keygen (For Defaults, click on Enter/Return key for both inputs)

    Generating public/private rsa key pair.
    Enter file in which to save the key (/Users/username/.ssh/id_rsa):      
    Enter passphrase (empty for no passphrase): 
    Enter same passphrase again: 
    Your identification has been saved in /Users/usernmae/.ssh/id_rsa.
    

    3) After that , Do "ls". you will find id_rsa.pub file.

    4) Copy the contents in the id_rsa.pub file (read using the cat command - cat id_rsa.pub)

    5) Navigate to BitBucket or any version tool which supports the SSH keys. Paste the contents using the Add Key Option

    That's it. Try to commit and push now.

提交回复
热议问题