0

I installed Jenkins in our Windows Server machine and wanted to run some scripts that clones our private repo from bitbucket. In the script, all it does is to clone the repo in the appropiate directory. So in Jenkins, I created a job that executed a Windows batch command and calls that batch file. When I run it, I get the following message:

The server's host key is not cached in the registry. You
have no guarantee that the server is the computer you
think it is.
The server's rsa2 key fingerprint is:
ssh-rsa 2048 a3:43:35:5f:e0:cf:df:1f:33:g5:e7:a6:32:f3:f8:63
If you trust this host, enter "y" to add the key to
PuTTY's cache and carry on connecting.
If you want to carry on connecting just once, without
adding the key to the cache, enter "n".
If you do not trust this host, press Return to abandon the
connection.

And there is no way I can enter y to accept this fingerprint key. We are using putty and plink tool for our keys. Is there a way where I can specify to accept this host fingerprint key?

Humberto Castellon
  • 849
  • 1
  • 7
  • 17
  • I think you should be able to disabled something like `StrictHostKeyChecking` - are you running SSH from windows? Can you add more detail about how you are executing this? – Tim Nov 20 '18 at 23:46
  • Can't add a comment because I don't have enough reputation. I can't use StrictHostKeyChecking because it is not secured due to man in the middle attack and this is on a windows server. With cmd, I was able to clone the repo and access the key fingerprint to cache, but for Jenkins, it's asking for it again with different fingerprint. I was researching online and I found something about plink with -hostkey option, but can't find one with an example – bubbles2189 Nov 21 '18 at 14:42
  • Hi, for your account bubbles2189 vs Johson Kareem, please use the contact us at the bottom, and ask to have the account merged – yagmoth555 Nov 21 '18 at 21:19

1 Answers1

0

Run the ssh client manually to connect to the host (as the user that your jenkins instance would use). Accept the host key. Afterwards the connection should work. You only have to do this once.

Gerald Schneider
  • 19,757
  • 8
  • 52
  • 79