使用SSH代理在Jenkins中配置从属节点

时间:2017-11-07 12:22:20

标签: jenkins

当我尝试使用SSH代理在Jenkins中配置从属节点时出现此错误。我该如何解决这个问题?

[11/07/17 13:13:05] [SSH] Checking java version of java
[11/07/17 13:13:05] [SSH] java -version returned 1.8.0_151.
[11/07/17 13:13:05] [SSH] Starting sftp client.
[11/07/17 13:13:05] [SSH] Remote file system root /home/Jenkins does not exist. Will try to create it...
java.io.IOException: Could not copy slave.jar into '/home/Jenkins' on slave
    at hudson.plugins.sshslaves.SSHLauncher.copySlaveJar(SSHLauncher.java:1152)
    at hudson.plugins.sshslaves.SSHLauncher.access$400(SSHLauncher.java:145)
    at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:816)
    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: Failed to mkdir /home/Jenkins
    at hudson.plugins.sshslaves.SFTPClient.mkdirs(SFTPClient.java:83)
    at hudson.plugins.sshslaves.SSHLauncher.copySlaveJar(SSHLauncher.java:1120)
    ... 7 more
Caused by: com.trilead.ssh2.SFTPException: Permission denied (SSH_FX_PERMISSION_DENIED: The user does not have sufficient permissions to perform the operation.)
    at com.trilead.ssh2.SFTPv3Client.expectStatusOKMessage(SFTPv3Client.java:555)
    at com.trilead.ssh2.SFTPv3Client.mkdir(SFTPv3Client.java:955)
    at hudson.plugins.sshslaves.SFTPClient.mkdirs(SFTPClient.java:81)
    ... 8 more
[11/07/17 13:13:05] Launch failed - cleaning up connection
[11/07/17 13:13:05] [SSH] Connection closed.

1 个答案:

答案 0 :(得分:0)

看起来您没有为您通过ssh登录的用户设置主目录,并且/home目录被锁定,因此用户无法创建它(应该如此)。您可能只需要在从属计算机上创建/home/jenkins,并为运行slave.jar的用户提供适当的权限。