我无法使用Jenkins CLI WAR登录我们的Dev @ Cloud实例。每次尝试,我都会收到以下消息:
您必须进行身份验证才能访问此Jenkins。
我的SSH密钥在我们的Jenkins实例和GrandCentral中设置。我尝试过执行login命令,但最终得到以下异常:
org.acegisecurity.userdetails.UsernameNotFoundException: Not Found or Not Authorized
at com.cloudbees.jenkins.plugins.dacsecurity.auth.CloudBeesUserDetailsService.loadUserByUsername(CloudBeesUserDetailsService.java:60)
at com.cloudbees.jenkins.plugins.dacsecurity.auth.CloudBeesUserDetailsService.loadUserByUsername(CloudBeesUserDetailsService.java:12)
at hudson.security.SecurityRealm.loadUserByUsername(SecurityRealm.java:305)
at hudson.cli.ClientAuthenticationCache.set(ClientAuthenticationCache.java:94)
at hudson.cli.LoginCommand.run(LoginCommand.java:37)
at hudson.cli.CLICommand.main(CLICommand.java:229)
at hudson.cli.CliManagerImpl.main(CliManagerImpl.java:92)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:275)
at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:256)
at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:215)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:326)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at hudson.cli.CliManagerImpl$1.call(CliManagerImpl.java:63)
at hudson.remoting.InterceptingExecutorService$2.call(InterceptingExecutorService.java:95)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
对此有任何帮助表示赞赏。
答案 0 :(得分:2)
试试这个
java -jar jenkins-cli.jar -s“https:// [username] .ci.cloudbees.com /” - i~ / .ssh / id_rsa help
如果您没有创建ssh密钥,请按照此帮助指南操作直到第3步 https://help.github.com/articles/generating-ssh-keys
your_email@example.com =可以是任何电子邮件,不一定是您在cloudbee帐户登录/设置中提供的电子邮件
答案 1 :(得分:1)
可能是连接时没有使用正确的ssh密钥的情况 - 它会查看〜/ .ssh / id_rsa等 - 与“ssh”命令相同。
如果您仍然无法解决问题 - 请打开一张电子邮件support@cloudbees.com,因为您可能需要更具体地谈谈您的设置
您可能需要在〜/ .ssh / config中输入一个条目,如:
Host account.ci.cloudbees.net
IdentityFile ~/.ssh/id_rsa
指向您要用于识别的私钥(如果您使用默认的私钥,则应该没问题)