Issue
I have configured Jenkins 2.7 and git in my Windows 10 machine. Using cmd or gitbash, I can clone Bitbucket repositories using an ssh key. The same URL is not working in Jenkins. Here is the error.
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
I have generated ssh key and copied to .ssh
folder in c:\users\myname\.ssh
and C:\Program Files (x86)\Jenkins\.ssh
.
In case of Linux OS, we can log in as Jenkins user and ssh to Bitbucket to verify the host. Not sure how to do that in Windows.
All the help available online are in Linux servers, nowhere I found the solutions specific to Windows.
Solution
Adding a HOME
variable in my user profile solved my problem.
HOME=c:\User\username
Answered By - user1726453
Answer Checked By - Pedro (JavaFixing Volunteer)