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 Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Jira

5 ways you can make the most of Jira Software and Bitbucket Cloud

As part of the Bitbucket product team I'm always interested in better understanding what kind of impact the use of our tools have on the way you work. In a recent study we conducted of software devel...

106 views 0 5
Read article

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