not able to connect to Jenkins slave

Not able to connect to jenkins salve by metioned steps in the course. This is error getting logged.

/var/lib/jenkins/.ssh/known_hosts [SSH] No Known Hosts file was found at /var/lib/jenkins/.ssh/known_hosts. Please ensure one is created at this path and that Jenkins can read it.

Key exchange was not finished, connection is closed. There was a problem while connecting to

at com.trilead.ssh2.Connection.connect(

at hudson.plugins.sshslaves.SSHLauncher.openConnection(

at hudson.plugins.sshslaves.SSHLauncher$

at hudson.plugins.sshslaves.SSHLauncher$


at java.util.concurrent.ThreadPoolExecutor.runWorker(

at java.util.concurrent.ThreadPoolExecutor$


Caused by: Key exchange was not finished, connection is closed.

at com.trilead.ssh2.transport.KexManager.getOrWaitForConnectionInfo(

at com.trilead.ssh2.transport.TransportManager.getConnectionInfo(

at com.trilead.ssh2.Connection.connect(

... 7 more

Caused by: The server hostkey was not accepted by the verifier callback

at com.trilead.ssh2.transport.KexManager.handleMessage(

at com.trilead.ssh2.transport.TransportManager.receiveLoop(

at com.trilead.ssh2.transport.TransportManager$

... 1 more

[09/04/18 03:38:02] Launch failed - cleaning up connection

[09/04/18 03:38:02] [SSH] Connection closed.

I have added the file with the below command, but still I can see the same issue.

command usee

ssh-keygen -H {IP Address } >> ~/.ssh/known_hosts



  • post-author-pic
    Will B

    Are you sure you created the file for the jenkins user, or just for your regular user? Try doing a "sudo su - jenkins" and then do the ssh-keygen -H.

  • post-author-pic
    Mohan A

    Good point, let me try that

Looking For Team Training?

Learn More