-1

I have installed Jenkins on remote server (ubuntu) and created a project. (https://www.digitalocean.com/community/tutorials/how-to-install-jenkins-on-ubuntu-16-04)

Then I created key pair using ssh-keygen and added public key to the bitbucket project. (https://confluence.atlassian.com/bitbucket/set-up-an-ssh-key-728138079.html) Now there is a capability to execute git commands on terminal of remote server such as git clone. and it works fine.

But the problem is when I add git repository to the jenkins Source Code Management section it shows an error of permission denied. Can anyone explain how can I set git repository on jenkin'ssource code management section correctly. I have added a SS of the error message.

Screen shot of Error

Sachithra Wishwamal
  • 117
  • 1
  • 2
  • 10
  • Possible duplicate of [Git error: "Host Key Verification Failed" when connecting to remote repository](https://stackoverflow.com/questions/13363553/git-error-host-key-verification-failed-when-connecting-to-remote-repository) – phd Nov 02 '18 at 22:40
  • https://stackoverflow.com/search?q=%5Bssh%5D+host+key+verification+failed – phd Nov 02 '18 at 22:40

1 Answers1

0

The error points to the host key missing in known_hosts file. Login to the jenkins server as user ‘jenkins’. Checkout you repo using ssh url, you will see a SSH warning when connecting to a new host for first time. Enter yes. The host key for bitbucket.org will now be added to the ~/.ssh/known_hosts file

That should resolve the error you are seeing

ben5556
  • 2,915
  • 2
  • 11
  • 16