2016-04-25 87 views
9

当在URL中打开我的Jenkins时,我似乎无法登录,它将抛出“用户缺少整体/读取权限”消息。我曾尝试使用类似问题的answer,但禁用安全功能无效。詹金斯继续抛出错误。有人建议我一起删除文件,但也失败了。任何人都可以提供给我的任何其他解决方案?Jenkins整体/读取权限

帖子我已经访问过包括:Jenkins Wiki

+0

您是否尝试设置JENKINS_HOME环境变量来强制Jenkins使用相关的Jenkins主文件夹? –

+0

没有,但我必须补充你,只是告诉我在哪里解决了我与詹金斯有关的另一个问题,那一个更重要,谢谢! –

回答

14

编辑/var/lib/jenkins/config.xml文件,并添加了您的管理员如下:

<authorizationStrategy class="hudson.security.ProjectMatrixAuthorizationStrategy"> 
. 
. 
<permission>hudson.model.Hudson.Administer:***Here is your username***</permission> 
. 
. 
</authorizationStrategy> 

不要忘了去重新启动服务器。 希望这有助于!

+1

我喜欢你的热情,但不幸的是没有工作。即使尝试创建新帐户并将配置设置更改为新帐户详细信息仍然是同样的错误。 –

+1

这对詹金斯2.32.2很有帮助。看起来比完全重新安装Jenkins容易得多。 – steve

+1

谢谢,解决方案在Jenkins 2.47上为我工作。 –

1

在Windows中:当我在全局安全下启用LDAP时,我也失去了我的管理权限。错误为“拒绝访问缺少整体/读取权限jenkins窗口”。

在这种情况下,请保留现有实例,在其他机器或虚拟机上安装新的jenkins。复制Jenkins_Home中的config.xml,并将其替换为Jenkin_Home目录中的config.xml。在执行此操作时,确保Jenkins服务已停止。一旦更换,启动实例和VOILA。

2

使用以下命令重新启动服务器詹金斯,

服务詹金斯重新启动

这对我的作品。

0
Disabling Security 
One may accidentally set up security realm/authorization in such a way that you may no longer able to reconfigure Jenkins. 

When this happens, you can fix this by the following steps: 

Stop Jenkins (the easiest way to do this is to stopthe servlet container.) 
Go to $JENKINS_HOME in the file system and find config.xml file. 
Open this file in the editor. 
Look for the <useSecurity>true</useSecurity> element in this file. 
Replace true with false 
Remove the elements authorizationStrategy and securityRealm 
Start Jenkins 
When Jenkins comes back, it will be in an unsecured mode where everyone gets full access to the system. 
If this is still not working, trying renaming or deleting config.xml. 

上面一旦我们回过头来在不安全模式詹金斯我们需要删除的用户,并添加新用户从https://jenkins.io/doc/book/system-administration/security/

所以引用。

0

[基于项目的矩阵授权策略相关]

你好,发生 同样的错误,我当我未选中全局/读取权限匿名。

如果您使用的是基于项目的矩阵信息插件,由于不清楚的原因,插件需要此​​读取权限。