Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Jira 8 Administration Cookbook

You're reading from   Jira 8 Administration Cookbook Over 90 recipes to administer, customize, and extend Jira Core and Jira Service Desk

Arrow left icon
Product type Paperback
Published in Jun 2019
Publisher
ISBN-13 9781838558123
Length 280 pages
Edition 3rd Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
Patrick Li Patrick Li
Author Profile Icon Patrick Li
Patrick Li
Arrow right icon
View More author details
Toc

Table of Contents (11) Chapters Close

Preface 1. Jira Server Administration FREE CHAPTER 2. Customizing Jira for Your Projects 3. Jira Workflows 4. User Management 5. Jira Security 6. Emails and Notifications 7. Integrations with Jira 8. Jira Troubleshooting and Administration 9. Jira Service Desk 10. Other Books You May Enjoy

Resetting the Jira administrator password

Sometimes, you might forget or lose the password to the account with the Jira administrator or Jira System Administrator permission, and you cannot retrieve it using the password reset option. For example, suppose Jira does not have an SMTP server configured, or you restored Jira from a data dump and do not know the account and/or password. In these cases, you need to reset the administrator password directly in the database.

This recipe only applies to Jira instances that use the default internal user directory option. External user management, such as LDAP, will not work with this recipe.

Getting ready

As we will reset the password stored in Jira's database, make sure you do the following:

  • Connect to the Jira database via either the command line or a GUI.
  • Update the Jira database records.

How to do it...

Let's assume we use the default mysql command-line tool and MySQL as the backend database for Jira. If you are using a different database, you may need to change the following SQL statements accordingly:

  1. Connect to the Jira database with a client tool by running the mysql -u jirauser -p command, where jirauser is the username used by Jira to access the Jira database.
  2. You can find Jira's database details from the dbconfig.xml file located in JIRA_HOME.
  3. Change to the Jira database by running the use jiradb command, where jiradb is the name of Jira's database.
  4. Determine the groups that have the Jira System Administrator global permission with the following SQL statement:
select perm_parameter from 
schemepermissions where PERMISSION=44;
  1. Find users that belong to the groups returned in the previous step by running the following SQL statement, where jira-administrators is a group returned from the previous step:
select child_name, directory_id
from cwd_membership where
parent_name='jira-administrators';
The jira-administrators group is the default group that administrators belong to. You might get a different group if you customize the permission configurations. The table column for the username is child-name.
  1. Reset the user's password in the database with the following SQL statement, where admin is a user returned in the previous step:
update cwd_user set
credential='uQieO/1CGMUIXXftw3ynrsaYLShI+
GTcPS4LdUGWbIusFvHPfUzD7
CZvms6yMMvA8I7FViHVEqr6Mj4pCLKAFQ==' where
user_name='admin';
  1. Restart Jira to apply the change.

How it works...

With Jira's internal user directory, all user and group data is stored in the Jira database. The value 44 is the ID of the Jira System Administrator global permission.

If you do not know which groups or users are granted the Jira System Administrator global permission, you will first have to find this information using steps 4 and 5. Otherwise, you can skip to step 6 in order to reset the password.

Jira's user password is stored in the cwd_user table. As Jira only stores the hash value of the password, we changed the user's admin password hash to uQieO/1CGMUIXXftw3ynrsaYLShI+GTcPS4LdUGWbIusFvHPfUzD7CZvms6yMMvA8I7FViHVEqr6Mj4pCLKAFQ==, which is the UTF-8-encoded hash value of sphere.

You have been reading a chapter from
Jira 8 Administration Cookbook - Third Edition
Published in: Jun 2019
Publisher:
ISBN-13: 9781838558123
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image