It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Need to reset admin password on bitbucket server

Jitendra Mohan Jun 11, 2018

Hi,

I installed BitBucket, JIRA and Confluence on a Linux server. I chose "admin" as the user name and the same complex password for all three. For a while I could login everywhere. 

Now, however, I can only login on JIRA. Cannot login to BitBucket nor to Confluence. When I click on "forgot password", I get the following error:

"Sorry, you can't retrieve your password as no email service has been configured for Confluence. Please contact your administrators for assistance."

Sending an outgoing mail on JIRA works, but I am not sure about BitBucket/Confluence and I have no way of checking.

These are pretty new version and for the most part, there is no/little actual data in them.

Any thoughts? 

3 answers

1 accepted

0 votes
Answer accepted
Christian Glockner Atlassian Team Jun 12, 2018

Hi Yogesh,

If you're completely unable to log into Bitbucket Server, you can use the lockout recovery process (see https://confluence.atlassian.com/bitbucketserver/lockout-recovery-process-776640158.html) to re-gain access, which then allows you to reset the password and configure SMTP.

Cheers,

Christian

Premier Support Engineer

Atlassian

Yogesh Mude Jun 12, 2018

HI @Jitendra Mohan

Please have a look at the above lockout recovery process link provide by @Christian Glockner

Hope it help.

Jitendra Mohan Jun 12, 2018

This worked!! I wish this answer was easier to find ... 

Thanks you very much.

Yogesh Mude Jun 12, 2018

Happy to hear, finally this works...

1 vote
Yogesh Mude Jun 11, 2018

HI @Jitendra Mohan

Welcome to the community!

Here is the document related to retrieving the admin password or you can reset the admin password but you should know the username for that.

In this documentation, you can find the DB queries using that you can do rest the admin password.

Jitendra Mohan Jun 11, 2018

Hi, I did try the suggestion but it did not work. Below is what I get after the change. As you can see, the password for the bitbucket admin is now set as described in the article. However, at the login prompt on the web, I cannot get in. I did not get a chance to setup SMTP therefore I cannot use it to reset password.

 

atlbitbucket=> select u.id, u.user_name, d.directory_name from cwd_user u inner join cwd_directory d on u.directory_id = d.id order by directory_name, user_name;

id | user_name | directory_name
--------+-----------+------------------------------
131073 | admin | Bitbucket Internal Directory
131074 | admin | Jira User Directory
(2 rows)

 

atlbitbucket=> select id, user_name, credential from cwd_user;
id | user_name | credential
--------+-----------+------------------------------------------------------------------------------------------
131073 | admin | uQieO/1CGMUIXXftw3ynrsaYLShI+GTcPS4LdUGWbIusFvHPfUzD7CZvms6yMMvA8I7FViHVEqr6Mj4pCLKAFQ==
131074 | admin | nopass
(2 rows)

Yogesh Mude Jun 11, 2018

Hi @Jitendra Mohan

As you can see the admin user belongs to Bitbucket Internal Directory so here you can run the below query and set the password for this admin user once done you can able to log with admin username.

update cwd_user set credential='uQieO/1CGMUIXXftw3ynrsaYLShI+GTcPS4LdUGWbIusFvHPfUzD7CZvms6yMMvA8I7FViHVEqr6Mj4pCLKAFQ==' where user_name='XXXX';

The password for this admin user is a sphere, After successful login with the username you can reset the password for your admin user 

Jitendra Mohan Jun 11, 2018

Yes, this is what I did. That is why in the second command, you can see that the user "admin" has the same password as you recommend. However, I still cannot login using password 'sphere'. 

Another thing I tried was to remove the "additional application" from under JIRA user server. Didn't help.

Ideas?

Jitendra Mohan Jun 11, 2018

I also restart the server between login attempts.

Yogesh Mude Jun 11, 2018

It should work man..we did many more times.

 

If you see here same admin user is available in both the directory ie Bitbucket Internal directory and Jira user directory hence might be it is confusion for the application to authenticate.

so please just reset the password for another user which belongs to Bitbucket Internal directory and the try to log in.

Jitendra Mohan Jun 12, 2018

I changed admin to admin_bitbucket. No luck. There are no other users in bitbucket directory (only admin or now admin_bitbucket). Only 3 users exist in JIRA directory.

atlbitbucket=> select id, user_name, credential from cwd_user;
id | user_name | credential
--------+-----------------+------------------------------------------------------------------------------------------
131074 | admin | nopass
131073 | admin_bitbucket | uQieO/1CGMUIXXftw3ynrsaYLShI+GTcPS4LdUGWbIusFvHPfUzD7CZvms6yMMvA8I7FViHVEqr6Mj4pCLKAFQ==
(2 rows)

Yogesh Mude Jun 12, 2018

ahh..sorry man.....i tried my best to solve this issue but no luck.:(

Jitendra Mohan Jun 12, 2018

Can I create a new admin user from scratch within the database?

Yogesh Mude Jun 12, 2018

You have changed the username from admin to admin_bitbucket but you should not do this. I said the check is there any other user is available in Bitbucket Internal directory then try to rest the password for that user and then log in.

Can I create a new admin user from scratch within the database?

Actually, don't know, please raise a support ticket to Atlassian they will help you. 

Jitendra Mohan Jun 12, 2018

Thank you. I changed it back to admin.

I think the problem happened as I directed bitbucket to use Jira directory. However, I did not grant all the required permissions as suggested here:

https://confluence.atlassian.com/bitbucketserver/connecting-bitbucket-server-to-jira-for-user-management-776640400.html

Now, once I logged out of BitBucket, it won't let me get back in.

Arrgh.

0 votes
Jitendra Mohan Jun 11, 2018

Hi, I did try the suggestion but it did not work. Below is what I get after the change. As you can see, the password for the bitbucket admin is now set as described in the article. However, at the login prompt on the web, I cannot get in. I did not get a chance to setup SMTP therefore I cannot use it to reset password.

 

atlbitbucket=> select u.id, u.user_name, d.directory_name from cwd_user u inner join cwd_directory d on u.directory_id = d.id order by directory_name, user_name;

id | user_name | directory_name
--------+-----------+------------------------------
131073 | admin | Bitbucket Internal Directory
131074 | admin | Jira User Directory
(2 rows)

 

atlbitbucket=> select id, user_name, credential from cwd_user;
id | user_name | credential
--------+-----------+------------------------------------------------------------------------------------------
131073 | admin | uQieO/1CGMUIXXftw3ynrsaYLShI+GTcPS4LdUGWbIusFvHPfUzD7CZvms6yMMvA8I7FViHVEqr6Mj4pCLKAFQ==
131074 | admin | nopass
(2 rows)

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder

...ipe.sh :  #!/bin/bash source "$(dirname "$0")/common.sh" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables R...

1,608 views 1 18
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you