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

[基於項目的矩陣授權策略相關]

你好,發生 同樣的錯誤,我當我未選中全局/讀取權限匿名。

如果您使用的是基於項目的矩陣信息插件,由於不清楚的原因,插件需要此​​讀取權限。