Repository access denied. access via a deployment key is read-only

前端 未结 18 2017
孤城傲影
孤城傲影 2020-11-29 15:49

After successfully cloning my repo from heroku and added another remote

1/ git clone git@heroku.com:[APP].git
2/ git remote add bitbucket ssh://git@bitbucket         


        
相关标签:
18条回答
  • 2020-11-29 16:17

    Two step process to be able to push pull
    Step1: Generate ssh key(public and private) on mac

    Step2: Put private key in mac and public key in git website

    below detailed steps are for mac users

    Step 1: Generating keys

    1. (make sure you have git installed)https://git-scm.com/download/mac
    2. open terminal and type ssh-keygen this will prompt you to enter storage location for key, you may type /Users/[machinename]/.ssh/[keyname]
    3. Next it will ask for passphrase, you can either leave it blank by pressing enter or enter some keyword to be entered again at next prompt
    4. This will have created two keys for you, private and public, with name [keyname] and [keyname].pub

    Step2:pushing keys to appropriate locations[mac and remote accounts i.e Github, bitbucket, gitlab etc ]

    1. Type ssh-add -K ~/.ssh/[keyname] in terminal to add your private key to the mac
    2. Type pbcopy < ~/.ssh/[keyname].pub to copy public key to clipboard
    3. Open account settings on your respective git website and go to add key, there paste the public key copied above

    Done, now you can push pull.

    0 讨论(0)
  • 2020-11-29 16:18

    I had this happen when I was trying to use a deployment key because that is exactly what I wanted.

    I could connect via ssh -T git@bitbucket.org and it would tell me I had access to read the repository I wanted, but git clone would fail.

    Clearing out ~/.ssh/known_hosts, generating a new key via ssh-keygen, adding that new key to bitbucket, and retrying fixed it for me.

    0 讨论(0)
  • 2020-11-29 16:19

    'Deployment Key' is only for Read Only access. Following is a good way to work through this.

    • Create and SSH key and add it to bitbucket (User Avatar -> Bitbucket Setting-> SSH keys)
    • ~/.ssh/known_hosts
    • ssh-add -D (Remove keys loaded to SSH agent)
    • ssh-add ~/.ssh/your_private_key_for_bitbucket
    • ssh git@bitbucket.org -Tv (Verify that your key is getting used to connect to bitbucket)
    • git push 'remote name' 'branch name'
    0 讨论(0)
  • 2020-11-29 16:20

    TLDR: ssh-add ~/.ssh/yourkey

    I've just worked through this problem.

    And none of the other answers helped.

    I did have a ./ssh/config with all the right stuff, also an earlier repository working fine (same bitbucket account, same key). Then I generated a deploy_key, and after that created a new repository.

    After that could not clone the new repo.

    I wish I knew how/why ssh agent was messing this up, but adding the key solved it. I mean adding the key in my local Ubuntu, not in bitbucket admin. The command is just

        ~/.ssh$ ssh-add myregualrkey
    

    Hope this helps someone.

    0 讨论(0)
  • 2020-11-29 16:21

    You have to delete the deployment key first if you are going to add the same key under Manage Account SSH Key.

    0 讨论(0)
  • 2020-11-29 16:21

    for this error : conq: repository access denied. access via a deployment key is read-only.

    I change the name of my key, example

    cd /home/try/.ssh/
    mv try id_rsa
    mv try.pub id_rsa.pub
    

    I work on my own key on bitbucket

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