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

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

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 Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

712 views 0 4
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot