Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Where do I save Git SSH key on Bamboo Windows Remote Agent

Tom Gibson March 18, 2014

I have set up a remote agent on WS2008 R2, installed native Git, checking out the repository works fine for the main repository (we use gitdepot with SSH keys) but I cannot get submodules to work at all.

I have found a number of threads on answers.atlassian.comand jira.atlassian.comas well as elsewhere on the internet discussing the problems with git and submodules, and in many places the idea that the SSH key must be passed to the agent or saved on the machine running the agent is suggested, but I cannot find any information on how to actually acheive this on Windows.

I have defined my SSH configuration using the file in %USERPROFILE%\.ssh\config and verified that in git bash I can clone successfully clone my repository and submodules using git clone --recurse-submodules and it uses the saved SSH credentials no problem. However no matter where I try to locate the same configuration files for the remote agent I just get Permission Denied when it tries to clone the submodule, clearly it's not picking up the credentials.

Where should I store them on my server in order for the Bamboo remote agent to pick them up? Thanks.

Update: If I configure a batch file in Bamboo to checkout the repository there are no problems, however I lose a lot of flexibility if I take this approach, I would much rather use the built in support. Any ideas?

3 answers

0 votes
Deleted user December 12, 2016

Is there any solution at last? I am having a Permission denied problem when trying to checkout a submodule as well (which is a separate repository in our Bitbucket host).

Here's my OP: https://answers.atlassian.com/questions/44907954 

0 votes
Dan Sarginson
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!
April 9, 2015

Did anything come of this? We're having precisely this problem and struggling for a solution...

0 votes
EddieW
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 27, 2014

Do you have tortoisegit installed, or any non-standard git tools?

My thought is that git config is the issue.

Both working examples rely on shells (bash or windows command) which typicallty have hooks to set environment properties.

Bamboo will exec out to git from a java process, and so git needs to know what SSH program to use, http://stackoverflow.com/questions/2499331/git-with-ssh-on-windows

I have defined my SSH configuration using the file in %USERPROFILE%\.ssh\config

Also, in addition to ssh config, do you have your private key (id_rsa) in %USERPROFILE%/.ssh/ ?

Tom Gibson March 27, 2014

Thanks for your suggestions, I'm using msysgit Git-1.9.0-preview20140217 from their google code page, I don't have any other front end installed at the moment. I've been playing around a lot with configurations and have located my private key in the id_rsa file under %USERPROFILE%/.ssh/ it's also specified in the config file in the following format:

Host gitdepot 10.0.0.1
User git
IdentityFile ~/.ssh/id_rsa

Since this configuration is sufficient for git bash (or cmd prompt when git is added to my path) to checkout and update the submodules, my conclusion is either bamboo is not using %USERPROFILE%/.ssh/ or the environment variables are different when it performs the checkout. I've run a batch script right before the checkout to output the environment variables and path and that seems to indicate it should be using correct value for %USERPROFILE%, so that leads me to surmise that it's somehow configuring git to look elsewhere.

I also wondered if there is some problem being introduced by the fact that the main repository is checked out via the git proxy, the IP in the log file when it does the main checkout is 127.0.0.1.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events