Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Team SSH key does not have access to all team's repositories

Robbe Sneyders
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 28, 2018

I have two repositories, REPO1 and REPO2, which are both owned by the same team. When running the pipeline of REPO1, I need to have write access to REPO1 and read access to REPO2.

I tried to enable this by generating an SSH key for the pipeline in REPO1, and adding the SSH key to the team account. This allows me to write to REPO1, but throws the following error when trying to clone REPO2:

Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights 
and the repository exists.
Command "git clone -q ssh://bitbucket.org/team/REPO2.git /tmp/pip-req-build-49zb0fvl" failed with error code 128 in None

It seems to me that adding the SSH key to the team account should grant read/write access to all its repositories?

Git cloning REPO2 does work when I add the SSH key as an access key to REPO2. However I cannot add it to the team account and REPO2 at the same time, so I lose write access to REPO1.

I know I can solve this by adding multiple SSH keys to the pipeline, but I would not like to go there unless it is absolutely necessary.

1 answer

0 votes
Philip Hodder
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 3, 2018

Hi Robbe,

Can you provide a few more steps on how to reproduce your issue? I did the following and everything seemed to work fine.

  1. I created a new team called "testphil'
  2. I created two new repositories called "repo1" and "repo2"
  3. I enabled Pipelines on repo2.
  4. On repo2, I generated a SSH key.
  5. I add that SSH key as an SSH for testphil team
  6. I then run the following Pipeline on repo2, which successfully clones repo1
image: atlassian/default-image:2
pipelines
:
default:
- step:
script:
- echo "Everything is awesome!"
- git clone git@bitbucket.org:testsshphil/repo1.git

Can you retry the SSH key creation again, with the same procedure as I did above.

Thanks,

Phil

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events