Dims
Dims

Reputation: 51229

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.

Upvotes: 8

Views: 6451

Answers (3)

Max Farsikov
Max Farsikov

Reputation: 2763

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

Upvotes: 4

thm
thm

Reputation: 604

As already said, you need to accept/validate the other server. Another option for that would be to just connect to the server via ssh. Normally you will be asked to accept the server and the servers fingerprint will be added permanently to your known_hosts file.

Upvotes: 0

Samir
Samir

Reputation: 181

Try this:

 ssh.settings {
      knownHosts = allowAnyHosts
 }

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

Upvotes: 18

Related Questions