Where do I stick ssh keys for submodules?

I'm running bamboo under my own user account. My home directory is C:/Users/me/. The bamboo home is C:/Users/me/bamboo-home/. Under my home directory I have .ssh/id-rsa and .ssh/id-rsa.pub.

When I run git submodule update --init from git bash all my submodule update properly.

My bamboo plan is configured to pull from bitbucket using ssh. I've told it to use C:/Users/me/.ssh/id-rsa as it's private key file, and provided it with the passphrase for that key. As indicated above, that ssh key and pasphrase work with all the submodules in my repository. The bamboo plan is configured to use submodules.

When I run my bamboo plan it clones the original repository fine, but fails while checking out submodules.

Permission denied (publickey).

If I make a copy of C:/Users/me/.ssh in C:/Users/me/bamboo-home/.ssh I recieve the same error.

What do I have to do to make bamboo use my original ssh ke/passphrase on submodules? If I need to set up a new ssh key without a passphrase I can do that, but what directory should I put it in that bamboo will pick it up and use it. Is there a configuration setting in bamboo so I can setup deploy-keys?

Edit: I've tried moving both base repository and one of the submodules to https instead of ssh. I configured the base repository to use my bitbucket login and password. The submodule is also under my bitbucket account. After doing this, bamboo pulls the base repository fine, but just sort of hangs when trying to fetch the submodule.

Edit2: I've created ssh keys with no passphrase and put them in C:/Users/me/bamboo-home/.ssh. I setup the bamboo plan to use this key, as well as setting them up with my bitbucket user. This has resulted in the same behavior as last time.

4 answers

1 accepted

Accepted Answer
1 vote

Hi,

The problem is, I believe, caused by Windows' mechanism called Virtual Store. This functionality is intended to prevent user from accidentally changing important files. Unfortunately, it also cause ssh to store its files into weird places.

2 things you can try:

1) copy your .ssh into sth like that:

C:\Users\me\AppData\Local\VirtualStore\Program Files (x86)\Git\.ssh

(above assumes 64 bit windows, on 32bit the path is simply 'Program Files')

2) use this script:

C:\Program Files (x86)\Git\cmd\git.cmd

as your Git executable in Bamboo. This script resolves the path problem so Git is no longer 'confused' by Virtual Store thingy.

I hope this helps.

I tried the second option first and everything is working fine now, though I still had the non-passcode keys in my user/.ssh leftover from a previous test. But that's something I can change around once we get bamboo runnig under a dedicated service account. Thanks!

Ran into the same problem,

1) Couldn't find Virtual store in ~/AppData/Local

2) Have tried this (Git 1.8.3), git.cmd is no longer there, it's replaced by git.exe (also a wrapper), and it does not work.

Marcin do you have another suggestion? Thanks!

On Windows you have to create HOME system environment variable pointing to the directory where .ssh folder is.

ex:

if .ssh folder is at C:/Users/Bamboo-Admin/.ssh than

HOME=C:/Users/Bamboo-Admin



I did this. I used a user variable instead of a system variable since Bamboo is running under Administrator. I also had to create a new ssh key that didn't require a passphrase.

Same problem here:

1. the virtual store folder described in solution 1 do no exist, if I create them, still doesn't work

2. git.cmd is gone, using cmd/git.exe version does not solve the problem.

I have the same issue on Ubuntu and Bamboo 5.7.1 build 5715. Tried to add separate source code checkout for the repositor linked as submodule (which was failed to init/checkout as a submodule) — works great.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Monday in Jira Ops

Jira Ops Early Access Program Update #1: Announcing our next feature and a new integration

Thanks for signing up for Jira Ops! I’m Matt Ryall, leader for the Jira Ops product team at Atlassian. Since this is a brand new product, we’ll be delivering improvements quickly and sharing updates...

539 views 0 9
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you