Reputation: 21
Hello everubody , i have this problem when i want to configure a slave node in jenkins with the SSH-agent method , can you help me to resolve this problem ?
11/01/17 12:16:15] [SSH] Opening SSH connection to 192.168.226.197:22.
/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.
java.io.IOException: There was a problem while connecting to 192.168.226.197:22
at com.trilead.ssh2.Connection.connect(Connection.java:834)
at com.trilead.ssh2.Connection.connect(Connection.java:703)
at com.trilead.ssh2.Connection.connect(Connection.java:617)
at hudson.plugins.sshslaves.SSHLauncher.openConnection(SSHLauncher.java:1284)
at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:804)
at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:793)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.IOException: Key exchange was not finished, connection is closed.
at com.trilead.ssh2.transport.KexManager.getOrWaitForConnectionInfo(KexManager.java:95)
at com.trilead.ssh2.transport.TransportManager.getConnectionInfo(TransportManager.java:237)
at com.trilead.ssh2.Connection.connect(Connection.java:786)
... 9 more
Caused by: java.io.IOException: The server hostkey was not accepted by the verifier callback
at com.trilead.ssh2.transport.KexManager.handleMessage(KexManager.java:548)
at com.trilead.ssh2.transport.TransportManager.receiveLoop(TransportManager.java:790)
at com.trilead.ssh2.transport.TransportManager$1.run(TransportManager.java:502)
... 1 more
[11/01/17 12:16:15] Launch failed - cleaning up connection
[11/01/17 12:16:15] [SSH] Connection closed.
Upvotes: 1
Views: 14884
Reputation: 4274
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.
On the Master’s machine, you can use ssh-copy-id command connect to agent:
ssh-copy-id [-p agent-ssh-port] agent-user@agent-hostname
On the Master, Relaunch the agent in Jenkins Nodes.
Upvotes: 0
Reputation: 475
In your agent configuration, for "Host Key Verification Strategy" you probably have "Known hosts file verification strategy". But when master initiates ssh connection - it doesn't update the known host file. So, you can try to execute ssh command manually to initiate a connection and update the file appropriately.
And of course you can disable "Know hosts file verification strategy" by setting "Non verifying Verification Strategy", but it is insecure.
Upvotes: 5