Setting an SSH key for bitbucket

Hi Edi,

I responded to your support ticket, but I’m copying the instructions for anyone else who wants to SSH with Bitbucket projects.


To get Bitbucket SSH working:

  1. Add the CircleCI-generated User Key to Bitbucket. This is the current workaround while we work with Bitbucket automate this via their API:

    a. From the CircleCI project settings page, on the “Checkout SSH Keys” page, open Inspect Element in your browser’s developer tools.
    b. Click Create User Key
    c. Find the new public key generated in the Network tab.
    d. Go to your Bitbucket account and add it manually. (“Bitbucket settings” -> “SSH Keys” -> “Add Key”)

    When this step was successful, I saw “Enable SSH” on a 2.0 “Rebuild with SSH” step, as in the attached screenshot:

  2. Add my local public key to Bitbucket. (Also: “Bitbucket settings” -> “SSH Keys” -> “Add Key”, more info here)

    When this step was successful, I was able to run ssh -Tv git@bitbucket.org, which finished with “debug1: Exit status 0”.

  3. Only after 1 and 2 are complete, run a new build with “Rebuild with SSH”. I tried to SSH into a build that I started before verifying steps 1 or 2 and they still failed.