How to log into git bitbucket repository from jenkins <p>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.</p> <p>However I am unable to get jenkins to actually check out the code from bitbucket. It always says:</p> <pre><code>Permission denied (publickey). fatal: The remote end hung up unexpectedly </code></pre> <p>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:</p> <pre><code>Host bitbucket.org IdentityFile ~/.ssh/id_dsa </code></pre> <p>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.</p> <p>Did anyone manage to make this setup work? I also read the following thread here on stackoverflow that was of no use to me: <a href="http://stackoverflow.com/questions/6323434/how-do-i-set-a-private-ssh-key-for-hudson-jenkins-to-access-bitbucket">How do i set a private ssh key for hudson / jenkins to access bitbucket?</a> 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.</p>