The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Disable LDAP authentication Command Line - Locked out of Jira

FreeSoftwareServers
October 7, 2016

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?

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
FreeSoftwareServers
October 8, 2016

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.

devopsinfoltd
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 5, 2018

You have missed couple of query, due to which when you'll try to login, it'll throw an error:

You do not have a permission to log in. If you think this is incorrect, please contact your Jira administrators.

 

insert into cwd_membership values (666666,888888,999999,'GROUP_USER','','jira-administrators','jira-administrators','localadmin','localadmin',1);
insert into cwd_membership values (555555,777777,999999,'GROUP_USER','','jira-users','jira-users','localadmin','localadmin',1);
0 votes
hanoy_2529
Banned
June 10, 2024

ต้องการยารักษาแค่ไหนก็บอกหมดนะครับแต่อาจจะจึดไปนะครับคือมันหน้าจะแรงกว่านี้ครับได้ผสมได้อาจจะนะครับคือมันติดยากอะครับทุกคนมีข้อคิดเห็นยังไงก็บอกหมอเค้านะ ครับใหญ่หรือเล็กจะไปก็ไปครับ มาก็มาดิมาดิมาดิมานี้ครับอารมย์ไม่จำเป็นต้องดีในวันนี้แม้ไม่มีใครติดต่อมาเลยครับ ปม้งเลยขาดยาหรอกมั้ง