Jenkins master无法使用OpenSSH

时间:2018-05-14 19:59:52

标签: jenkins windows-10 openssh

我安装了Windows 10,安装了最新版本的OpenSSH for Windows。我试图用它作为我詹金斯的奴隶。这是主服务器上的日志内容:

    [05/14/18 22:46:45] [SSH] Opening SSH connection to 10.10.10.10:22.
    [05/14/18 22:46:45] [SSH] WARNING: SSH Host Keys are not being verified. Man-in-the-middle attacks may be possible against this connection.
    [05/14/18 22:46:45] [SSH] Authentication successful.
    [05/14/18 22:46:45] [SSH] The remote user's environment is:
....
[05/14/18 22:46:45] [SSH] Checking java version of java
[05/14/18 22:46:45] [SSH] java -version returned 1.8.0_151.
[05/14/18 22:46:45] [SSH] Starting sftp client.
[05/14/18 22:46:45] [SSH] Copying latest slave.jar...
[05/14/18 22:46:45] [SSH] Copied 762,466 bytes.
Expanded the channel window size to 4MB
[05/14/18 22:46:45] [SSH] Starting slave process: cd "C:\jenkins" && java  -jar slave.jar -jar-cache "C:\jenkins\remoting\jarCache"
<===[JENKINS REMOTING CAPACITY]===><===[JENKINS REMOTING CAPACITY]===>ERROR: Unexpected error in launching a slave. This is probably a bug in Jenkins.
hudson.remoting.RequestAbortedException
Exception in thread "main" java.io.EOFException: unexpected stream termination
ERROR: Connection terminated
    at hudson.remoting.ChannelBuilder.negotiate(ChannelBuilder.java:408)    at hudson.remoting.Request.call(Request.java:176)
java.io.EOFException
    at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2671)
    at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:3146)
    at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:858)
    at java.io.ObjectInputStream.<init>(ObjectInputStream.java:354)
    at hudson.remoting.ObjectInputStreamEx.<init>(ObjectInputStreamEx.java:48)
    at hudson.remoting.AbstractSynchronousByteArrayCommandTransport.read(AbstractSynchronousByteArrayCommandTransport.java:35)
    at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:63)
Caused: java.io.IOException: Unexpected termination of the channel
    at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:77)

    at hudson.remoting.Channel.call(Channel.java:951)
    at hudson.remoting.ChannelBuilder.build(ChannelBuilder.java:353)    at hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:549)
    at hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:416)
    at hudson.plugins.sshslaves.SSHLauncher.startSlave(SSHLauncher.java:1110)
    at hudson.plugins.sshslaves.SSHLauncher.access$500(SSHLauncher.java:148)
    at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:845)
    at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:820)
    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)

    at hudson.remoting.Launcher.main(Launcher.java:743)
    at hudson.remoting.Launcher.runWithStdinStdout(Launcher.java:691)
    at hudson.remoting.Launcher.run(Launcher.java:373)[05/14/18 22:46:47] Launch failed - cleaning up connection

    at hudson.remoting.Launcher.main(Launcher.java:283)
[05/14/18 22:46:47] [SSH] Connection closed.

因此,ssh auth成功,但由于某种原因启动客户端jar失败。我不确定究竟应该检查什么。有没有其他人与Win 10和OpenSSH斗争?

1 个答案:

答案 0 :(得分:2)

请参阅JENKINS-42856中的评论,然后按照说明配置OpenSSH 测试你可以通过执行像这样的命令来运行没有tty的命令

ssh USERNAME@AGENT_HOST /bin/bash -c ls