title: Jenkins CLI: using Anonymous permissions instead of the user defined ones
body: <p>I am getting mad with this problem and I have no idea how to solve it.</p>
  
  <p>We are trying to trigger Jenkins builds from hooks on a Windows Central repository. This is actually working on an old Jenkins server (LTS 1.580.1). </p>
  
  <p>The way we did it before was calling Jenkins CLI with the SSH private key stored on a file.</p>
  
  <p>Here is the weird thing:</p>
  
  <blockquote>
    <p>C:\Users\Username\jenkins>java -jar jenkins-cli.jar -s <a href="http://hostname:8080" rel="nofollow">http://hostname:8080</a> -i ci.key list-jobs</p>
  </blockquote>
  
  <pre><code>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)
  </code></pre>
  
  <p>The jenkins_ci user is an Active Directory Service Account which mostly worked with everything. In the Jenkins security matrix I have the same permissions that this service account.</p>
  
  <p>When I use my ssh key and run exactly the same command, it worked like a charm.</p>
  
  <p>If I run who-I-am it said "jenkins_ci" BUT if I change Anonymous permissions then jenkins_ci started to work.
  It seems that it is not reading the defined user permissions and it is using the Anonymous ones instead.</p>
  
  <p>Any ideas how to make it work? Is this one a bug that I should report to Jenkins or am I missing anything?</p>
  
  <p>Thanks!</p>