Jenkins CLI:使用匿名权限而不是用户定义的权限

Jenkins CLI:使用匿名权限而不是用户定义的权限,jenkins,command-line-interface,ssh-keys,Jenkins,Command Line Interface,Ssh Keys,我对这个问题很生气,我不知道如何解决它 我们正在尝试从Windows中央存储库上的挂钩触发Jenkins构建。这实际上是在旧的Jenkins服务器(LTS 1.580.1)上工作的 我们之前的做法是使用存储在文件中的SSH私钥调用Jenkins CLI 奇怪的是: C:\Users\Username\jenkins>java-jar jenkins-cli.jar-s-i ci.key列表作业 jenkins_ci用户是一个Active Directory服务帐户,主要处理所有事务。在Jenki

我对这个问题很生气,我不知道如何解决它

我们正在尝试从Windows中央存储库上的挂钩触发Jenkins构建。这实际上是在旧的Jenkins服务器(LTS 1.580.1)上工作的

我们之前的做法是使用存储在文件中的SSH私钥调用Jenkins CLI

奇怪的是:

C:\Users\Username\jenkins>java-jar jenkins-cli.jar-s-i ci.key列表作业

jenkins_ci用户是一个Active Directory服务帐户,主要处理所有事务。在Jenkins安全矩阵中,我拥有与此服务帐户相同的权限

当我使用ssh密钥并运行完全相同的命令时,它就像一个符咒

如果我运行who-I-am,它会显示“jenkins_ci”,但如果我更改匿名权限,jenkins_ci就会开始工作。 它似乎没有读取定义的用户权限,而是使用匿名权限

有什么办法让它工作吗?这是我应该向詹金斯报告的错误还是我遗漏了什么


谢谢

好吧,在花了好几个小时做这件事之后,我有了一个“好主意”,它成功了

我们的Jenkins正在使用LDAP对Active Directory进行身份验证

不知何故,Jenkins创建的用户(及其用户文件夹)是: “jenkins_ci”(小写)我们的Active Directory帐户是“jenkins_ci”(大写)

Jenkins security似乎在某种程度上区分大小写

我停止了Jenkins,删除了主机上的用户文件夹,然后启动了Jenkins。
新文件夹现在名为JENKINS_CI,现在CLI正在工作。

java-jar JENKINS-CLI.jar-s get job myjob>myjob.xml

我能够运行上面的命令使用下面的链接

hudson.security.AccessDeniedException2: jenkins_ci is missing the Overall/Read permission
         at hudson.security.ACL.checkPermission(ACL.java:58)
         at hudson.model.Node.checkPermission(Node.java:417)
         at hudson.cli.CLICommand.main(CLICommand.java:236)
         at hudson.cli.CliManagerImpl.main(CliManagerImpl.java:92)
         at sun.reflect.GeneratedMethodAccessor345.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
         at java.lang.reflect.Method.invoke(Method.java:483)
         at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:320)
         at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:295)
         at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:254)
         at hudson.remoting.UserRequest.perform(UserRequest.java:121)
         at hudson.remoting.UserRequest.perform(UserRequest.java:49)
         at hudson.remoting.Request$2.run(Request.java:324)
         at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
         at hudson.cli.CliManagerImpl$1.call(CliManagerImpl.java:63)
         at hudson.remoting.CallableDecoratorAdapter.call(CallableDecoratorAdapter.java:18)
         at hudson.remoting.CallableDecoratorList$1.call(CallableDecoratorList.java:21)
         at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
         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)