Issue
- When managing user permissions, a user might set a permission wrong and lose access when using their main administrator account. Regaining access can be done in a few steps.
- global security needs to be changed, unable to login as administrator
Environment
- CloudBees CI (CloudBees Core) on modern cloud platforms - Managed controller
- CloudBees CI (CloudBees Core) on modern cloud platforms - Operations Center
- CloudBees CI (CloudBees Core) on traditional platforms - Client controller
- CloudBees CI (CloudBees Core) on traditional platforms - Operations Center
- CloudBees Jenkins Enterprise - Managed controller
- CloudBees Jenkins Enterprise - Operations Center
- CloudBees Jenkins Platform - Client controller
- CloudBees Jenkins Platform - Operations Center
- CloudBees Jenkins Distribution
- Jenkins LTS
Resolution
1) Stop Jenkins
2) Edit the config.xml file in the JENKINS_HOME
folder and locate this line:
`<useSecurity>true</useSecurity>`
Set the value to `false`
3) Start Jenkins
4) If you don’t know your admin
password when using Jenkins’ own user database
for your Security Realm
, go to:
```
JENKINS_URL/user/admin/configure
```
to set the new `admin` password.
5) Now go to Manage Jenkins
-> Configure Global Security
and choose your Security Realm
and Authorization
settings to re-enable security.
Note: an alternative to step 2 is to restore a known good configuration of JENKINS_HOME/config.xml
from a backup that was taken immediately before the Configure Global Security
changes were done that caused the issue. We recommmend you do a diff
of the current content of JENKINS_HOME/config.xml
and the version from the backup before you replace it, to ensure you understand what you are reverting.
Comments
2 comments
I'm using LDAP plugin for login. Everytime I restart my Jenkins Master I need to 'Edit the config.xml file in the JENKINS_HOME' and reconfigure my LDAP settings from scratch. Is there a way to avoid this cumbersome process?
Hi Namrata,
This should not be necessary if Jenkins is operating normally. If you are a CloudBees customer, feel free to raise a support ticket so that we can help you troubleshoot the issue.
Please sign in to leave a comment.