Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6721499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:20:14+00:00 2026-05-26T09:20:14+00:00

I have a GIT repository on bitbucket, which I want my Jenkins Server to

  • 0

I have a GIT repository on bitbucket, which I want my Jenkins Server to access automatically. This is only possible using public/private key authentication. So I created a key pair and uploaded the public key to bitbucket. The public and the private key are on my server in the .ssh folder of the tomcat user running jenkins. I am able to clone my project when I am logged in as that user on the server.

However I am unable to get jenkins to actually check out the code from bitbucket. It always says:

Permission denied (publickey).
fatal: The remote end hung up unexpectedly

Well I assume that this happens because when accessing the repository over ssh I need to provide the passphrase for my private key and jenkins is unable to do this automatically. I read that it is possible to avoid beeing asked for the passphrase by providing a config file inside the .ssh folder containing the following content:

Host bitbucket.org
    IdentityFile ~/.ssh/id_dsa

I did so, but as soon as I provide that file I can no longer clone the repository from bitbucket. Not even directly from the server, getting the same error message as shown above.

Did anyone manage to make this setup work? I also read the following thread here on stackoverflow that was of no use to me: How do i set a private ssh key for hudson / jenkins to access bitbucket? and I checked that tomcat really runs under user tomcat6 by creating an empty test project that simply runs “whoami”. So I am pretty much out of ideas for fixing the problem.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T09:20:14+00:00Added an answer on May 26, 2026 at 9:20 am

    Specifying an IdentityFile in your config doesn’t change whether you have to provide a password for the ssh key. That’d be a gaping security hole if it did. The only way you can not be required to provide a password for your ssh key is if your ssh key doesn’t have a password.

    So, you should create an ssh key specifically for your jenkins instance and, if Bitbucket allows, only give read-only access to your repository for that key.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a public Git repository on Bitbucket. I want to link the latest
I have a Git repository in bitbucket and another on my live rails server,
I have git repository (powered by gitosis) on my local ubuntu server I want
I have a git repository which tracks an svn repository. I cloned it using
I have one repository which I want to push into Bitbucket and GitHub. It
I have a git repository hosted on BitBucket, and have set up SSH authentication
Suppose I have Git repository like this: git-repo/ directory_1/ directory_2/ directory_3/ This has a
We have a git repository which contains source for a few related Java WARs
I have a git repository with submodules in the directory projects/myRepo and I want
I have a Git repository which I have started to develop on master branch

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.