Jenkins SSH 从机无法创建 /home/<user>/jenkins

Pap*_*cel 5 linux ssh amazon-ec2 jenkins

在 Jenkins(在 ec2 实例上运行)上配置 ssh 从属时,当我单击“启动从属代理”时,我收到以下错误消息。

[08/06/14 18:41:46] [SSH] Opening SSH connection to ec2-xx-xx-xx-xx.eu-west-1.compute.amazonaws.com:22.
[08/06/14 18:41:46] [SSH] Authentication successful.
[08/06/14 18:41:46] [SSH] The remote users environment is:
[08/06/14 18:41:46] [SSH] Starting sftp client.
[08/06/14 18:41:46] [SSH] SFTP failed. Copying via SCP.
[08/06/14 18:41:46] [SSH] Remote file system root /home/<user>/jenkins does not exist. Will try to create it...
Failed to create /home/<user>/jenkins
[08/06/14 18:41:46] [SSH] Copying latest slave.jar...
hudson.util.IOException2: Could not copy slave.jar into '/home/<user>/jenkins' on slave
    at hudson.plugins.sshslaves.SSHLauncher.copySlaveJarUsingSCP(SSHLauncher.java:967)
    at hudson.plugins.sshslaves.SSHLauncher.copySlaveJar(SSHLauncher.java:926)
    at hudson.plugins.sshslaves.SSHLauncher.launch(SSHLauncher.java:596)
    at hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:228)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)
Caused by: java.io.IOException: Error during SCP transfer.
    at com.trilead.ssh2.SCPClient.put(SCPClient.java:523)
    at hudson.plugins.sshslaves.SSHLauncher.copySlaveJarUsingSCP(SSHLauncher.java:965)
    ... 7 more
Caused by: java.io.IOException: Remote scp terminated unexpectedly.
    at com.trilead.ssh2.SCPClient.readResponse(SCPClient.java:50)
    at com.trilead.ssh2.SCPClient.sendBytes(SCPClient.java:140)
    at com.trilead.ssh2.SCPClient.put(SCPClient.java:519)
    ... 8 more
[08/06/14 18:41:46] [SSH] Connection closed.
Run Code Online (Sandbox Code Playgroud)

该节点的 Jenkins 配置如下:

詹金斯配置

请注意,我设置了 JavaPath 属性,因为 Jenkins“无法找出 java 的 Java 版本”(这是我收到的错误消息)

知道如何解决这个问题吗?谢谢

Gau*_*ose 0

您需要提供用户有权访问的 ec2 实例的有效路径。