Disable LDAP authentication Command Line - Locked out of Jira

So I setup LDAP Auth and tested configurations fine. Everything went great, so I logged out and went to log in.

Now I can't log in via LDAP or my local User. It just keeps giving me Captcha's and saying either your not permitted to login, or your login requires a captcha.

I have CLI access to the server, there has got to be a way for me to recovery my JIRA Instance! This is really a HUGE deal to be locked out of Jira. I am 99% sure I didn't disable Local Login, but its below LDAP on the list of methods to use. I cant even log in via my LDAP user anymore, but they don't have admin rights....

How can I disable/delete the LDAP configs from the CLI?

1 answer

https://confluence.atlassian.com/jira/retrieving-the-jira-administrator-192836.html

Add a new 'localadmin' user with the password sphere:

mysql -uroot -p
use jiradb;
insert into cwd_user values (999999,1,'localadmin','localadmin',1,'2012-01-04 19:49:05-08','2012-01-04 19:49:05-08','local','local','admin','admin','local admin','local admin','localadmin@localadmin.com','localadmin@localadmin.com','uQieO/1CGMUIXXftw3ynrsaYLShI+GTcPS4LdUGWbIusFvHPfUzD7CZvms6yMMvA8I7FViHVEqr6Mj4pCLKAFQ==',NULL,NULL);
insert into app_user values(999999,'localadmin','localadmin');
insert into cwd_group(id, group_name, lower_group_name, active, local, created_date, updated_date, description, lower_description, group_type, directory_id)
values ( '888888','jira-administrators','jira-administrators',1,0,'2011-03-21 12:20:29','2011-03-21 12:20:29',NULL,NULL,'GROUP',1);
insert into cwd_group(id, group_name, lower_group_name, active, local, created_date, updated_date, description, lower_description, group_type, directory_id)
values ( '777777','jira-users','jira-users',1,0,'2011-03-21 12:20:29','2011-03-21 12:20:29',NULL,NULL,'GROUP',1);
insert into globalpermissionentry (id, permission, group_id) values (555555,'SYSTEM_ADMIN','jira-administrators');
insert into globalpermissionentry (id, permission, group_id) values (444444,'ADMINISTER','jira-administrators');
insert into globalpermissionentry (id, permission, group_id) values (333333,'USE','jira-users');
update cwd_directory set active = 1 where id = 1;
flush privileges;
quit;
sudo service jira stop && sudo service jira start

This didn't actually disable LDAP, but gave me a localadmin to log in as to do what I needed in the WebGUI like disable LDAP and change users etc etc.

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,998 views 12 18
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot