Connecting Jenkins to Bitbucket server on a Windows 2012 R2 machine using SSH key

Ben238 July 14, 2017

Hi,

I am using a Windows 2012 R2 server on which I have installed my Bitbucket server and Jenkins.

I have also installed openSSH and as far as I can tell the ssh service is running ok.

I logon to the server using a certain account (say WinServUsername) and have a different MyUsername to connect to both Bitbucket and Jenkins.

I have created a ssh key under "C:\Users\WinServUsername" and added the host mycomputer.

I have tried to follow advices from https://community.atlassian.com/t5/Continuous-Delivery-questions/Connecting-Bitbucket-and-Jenkins/qaq-p/81239/page/2

but so far I still get permission denied when trying to add the rep to a jenkins job.

In jenkins I have created 3 type of "Username and SSH key" credentials:

1/ MyUsername and SSH key copied manually from "C:\Users\WinServUsername\.ssh\id_rsa.pub"

2/ WinServUsername and SSH key copied manually from "C:\Users\WinServUsername\.ssh\id_rsa.pub"

3/ jenkins and SSH key copied manually from "C:\Users\WinServUsername\.ssh\id_rsa.pub"

Non of these credentials work.

Has someone done it and could help me to figure out what I am doing wrong?

Thank you.

Ben

1 answer

1 accepted

1 vote
Answer accepted
Ben238 July 18, 2017

Well I actually wrote three times my mistake above (maybe that is why it finally sunk in):

Credentials in Jenkins must be:

2/ WinServUsername and SSH key copied manually from "C:\Users\WinServUsername\.ssh\id_rsa" from the private key and not the public one

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events