Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,465,932
Community Members
 
Community Events
176
Community Groups

Need to reset admin password on bitbucket server

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

3 votes
Answer accepted

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

HI @jitendramohan

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

Hope it help.

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

Thanks you very much.

Happy to hear, finally this works...

This worked for me as well!

However, I'd like to amend a stumbling block I had to overcome:

First, I tried to run <Bitbucket installation directory>\bin\start-bitbucket.sh using sudo -u bitbucket but then Bitbucket failed to start.

So I tried again as root (just using sudo) wich worked.

But after having repaired my user access and re-starting Bitbucket the standard way, it failed with some obscure problems not being able to initiate classes.

Assuming that running from root may have changed access rights of some files, I tried

sudo chown -R /var/bitbucket

which in fact fixed the problem.

1 vote

HI @jitendramohan

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.

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)

Hi @jitendramohan

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 

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?

I also restart the server between login attempts.

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.

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)

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

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

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. 

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.

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
TAGS

Atlassian Community Events