Jenkins没能启动奴隶特工

vnzz0bqm  于 2023-11-17  发布在  Jenkins
关注(0)|答案(1)|浏览(138)

我正在尝试启动新的奴隶代理,但我看到下面的错误。你能帮助解决这个问题吗?

  • 我已经复制了两台机器的密钥在.ssh/authorized_keys和能够连接手动,但失败,从Jenkins。
  • 所有的权限看起来也不错。
[02/19/16 13:12:34] [SSH] Opening SSH connection to sdc-caoneops-    app1.qa.xxxxx.com:22.
    ERROR: Server rejected the 1 private key(s) for App (credentialId:6aced962-  26cd-4c8f-97d3-305c2e2a6540/method:publickey)
    [02/19/16 13:12:34] [SSH] Authentication failed.
    hudson.AbortException: Authentication failed.
    at hudson.plugins.sshslaves.SSHLauncher.openConnection(SSHLauncher.java:1178)
    at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:701)
    at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:696)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at    java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
    [02/19/16 13:12:34] Launch failed - cleaning up connection
    [02/19/16 13:12:34] [SSH] Connection closed.

字符串

gt0wga4j

gt0wga4j1#

当您手动从master到slave进行ssh时,您是以Jenkins master用户的身份进行的,对吗?您只需要将master的公钥复制到slave的~/.ssh/authorized_keys中。

  • 为jenkins私钥添加Jenkins Credentials,并在从属配置**“Credentials”**中使用该对。
  • 在slave配置中,在**“Remote root directory”**中添加slave上jenkins用户的home目录(包含.ssh/authorized_keys)

相关问题