当我在URL中打开我的Jenkins时,我似乎无法登录它会抛出消息"用户缺少整体/读取权限".我尝试过类似问题的答案,但禁用安全性不起作用.詹金斯继续抛弃错误.有人建议我一起删除文件但也失败了.任何人都可以提供给我的任何其他解决方案?
我访问过的帖子包括:Jenkins Wiki
小智 22
编辑/var/lib/jenkins/config.xml文件并将您添加为Admin,如下所示:
<authorizationStrategy class="hudson.security.ProjectMatrixAuthorizationStrategy">
.
.
<permission>hudson.model.Hudson.Administer:***Here is your username***</permission>
.
.
</authorizationStrategy>
Run Code Online (Sandbox Code Playgroud)
别忘了去重启服务器.希望这可以帮助!
我发现了另一种可能发生这种情况的情况:
我有一个用全小写用户名(例如“john.doe”)定义的用户,但是当这个用户被分配一个角色时,他们的用户名输入了不同的大小写(例如“John.Doe”)。在这种情况下,用户能够登录,但角色未正确关联,因此未授予整体/读取权限。
为了解决这个问题,我简单地删除了角色分配的坏记录,并用适当的大小写重新创建了它。
Run Code Online (Sandbox Code Playgroud)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/
因此,一旦我们以不安全模式返回 jenkins,我们需要删除用户并添加新用户。
| 归档时间: |
|
| 查看次数: |
38375 次 |
| 最近记录: |