1
votes

I did setup jenkins with LDAP and i'm able to login. But when i stop the LDAP server I'm unable to login to jenkins using jenkin's local user account. Also always editing the config.xml is not a good idea to change security settings. Please help me.

4

4 Answers

0
votes

What Ive done in a previous role - is a copy of Jenkins config that allows admin & a selection of other users access when LDAP is down.

When LDAP is down , I switch manually

mv config.xml config.ldap.xml
mv config.internal.xml config.xml 

Restart Jenkins ( https://stackoverflow.com/a/8077830/1935094 )

The config.internal.xml was setup before I configured LDAP. You could also backup your config.xml , configure Jenkins for internal user access , copy that off and copy back in your LDAP configured config.xml.

Anyway - the idea is that you can still get in , run jobs etc until LDAP is back.

Ive had thoughts about automating it , if LDAP is detected as down ( you could run a lookup periodically , then switch if need be...

1
votes

As of now, local user login is not possible when LDAP enabled. Jenkins internal user database is automatically disabled when you activate LDAP authentication.

Few Jenkins JIRA to get more details on this.

  1. JENKINS-3404

  2. JENKINS-29162

There is no other way except editing ~.jenkins/config.xml.

0
votes

Better option is to migrate(LDAP user) to Jenkins own user database.

0
votes

FOR FUTURE:
- Add a secondary LDAP server on Jenkins host.
- Remember to check "Ignore if unavailable" on the first LDAP.

More info