Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

reject HostKey: when deploying JAR with gradle ssh plugin

I am trying to upload jar with Gradle and used Gradle SSH plugin: https://gradle-ssh-plugin.github.io/

Unfortunately, goal executed with error

* What went wrong:
Execution failed for task ':deploy'.
> reject HostKey: SERVERIPADDRESS

How to fix?

I found that there is similar error with Ant SSH task and it can be fixed with trust = true setting. Unfortunately, I can't find appropriate option here.

I.e. apparently, I need to configure SSH client so that it accept host's ID.

like image 395
Dims Avatar asked Apr 02 '16 14:04

Dims


2 Answers

Try this:

 ssh.settings {
      knownHosts = allowAnyHosts
 }

P.S: Sorry for editing mistakes, new to S.O.F.

like image 72
Samir Avatar answered Sep 26 '22 17:09

Samir


Run: ssh-keyscan -t rsa server.com >> ~/.ssh/known_hosts

Explanation: you have to add server SSH key info to your ~/.ssh/known_hosts file.

To obtain ssh-info run command ssh-keyscan -t rsa server.com and add its output to ~/.ssh/known_hosts

like image 39
Max Farsikov Avatar answered Sep 26 '22 17:09

Max Farsikov