Uploaded image for project: 'Bitbucket Cloud'
  1. Bitbucket Cloud
  2. BCLOUD-12926

Can't SSH into my Bitbucket repository - conq: repository access denied

    XMLWordPrintable

    Details

      Description

      I have followed a million guides regarding this and I cannot get it to work. Earlier, I successfully pushed via SSH to my private Bitbucket git repository, now suddenly it wont work.

      I have recreated the keys with a new passphrase, added it to my Bitbucket settings and it wont work.

      Okay, here are the steps I took:

      1. Deleted old key pair (project1 and project1.pub)
      2. Recreated it with this command ssh-keygen -f ~/.ssh/project1 -C "project1"
      3. Created a config in ~/.ssh file for my two Bitbucket accounts, with the following contents:
      #!
      
      Host project1
       HostName bitbucket.org
       IdentityFile ~/.ssh/project1
      Host project2
       HostName bitbucket.org
       IdentityFile ~/.ssh/project2
      
      1. Grabbed the contents of project1.pub and created a new SSH key entry in my Bitbucket account.
      2. Added ssh-agent in my ~/.zshrc plugin list like this: plugins=(git ssh-agent) and restarted Terminal
      3. Did ssh-add -l and saw only project2 was loaded
      4. Did ssh-add ~/.ssh/project1, entered my passphrase and success, like this:
      #!
      
      2048 SHA256:THESHA256 /Users/myuser/.ssh/project2 (RSA)
      2048 SHA256:THESHA256 /Users/myuser/.ssh/project1 (RSA)
      
      1. Restarted Terminal and did ssh-add -l and it listed both entries
      2. Went to my project and did git push and it told me I had no access.

      When I do ssh -T git@bitbucket.com, it tells me I'm logged in with the username of project2.

      logged in as project2_user.

      My system is OS X 10.11.5

      I could never fix multiple identities on my computer and always used HTTPS, but I need to make everything more secure with SSH, which also allows my account to have two-factor authentication. Therefore using SSH is a must now and I don't know what to do.

      P.S: I did the creating steps for the identity for project2 too, but I'm fairly certain that it doesn't work either.


      Guide I followed:

      https://confluence.atlassian.com/bitbucket/configure-multiple-ssh-identities-for-gitbash-mac-osx-linux-271943168.html


      project2 has no passphrase, while project1 does! Just thought maybe this is relevant.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            73783f9b56b2 dugajean
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: