The Biggest Problem With Bitbucket Admin Password Reset, And How You Can Fix It

tags: bitbucket login, bitbucket server,  bitbucket tutorial, bitbucket reset password, atlassian bitbucket, atlassian, bitbucket, git, git atlassian, git commands, bitbucket server login

Bitbucket Lockout Recovery Process

As an administrator, you may find yourself locked out of Bitbucket Server and unable to log in. This situation can arise when all users are managed externally from Bitbucket Server, and Bitbucket Server becomes unable to access those user directories for some reason, including
BITBUCKET_HOME:      /bitbucket/atlassian/application-data/bitbucket
CATALINA_BASE:           /opt/atlassian/bitbucket/4.0.3
Step  1: 

Locate your Bitbucket Home Directory 

ps  -ef   | grep  atl

Find following line “JVM_SUPPORT_RECOMMENDED_ARGS” in your CATALINA_BASE 

grep -HRn "JVM_SUPPORT_RECOMMENDED_ARGS" /opt/atlassian/bitbucket/4.0.3/bin

Screenshot Bitbucket Server Version 4.0.x 


for Windows, edit setenv.bat  file
For linux, edit setenv.bat file

Screenshot Bitbucket Server Version  5.X+, and later.


For Window, edit  _start-webapp.bat
For Linux, exit  _start-webapp.sh

Step 2:

Open file as per the your bitbucket server version :
vi  /opt/atlassian/bitbucket/4.0.3/bin/setenv.sh
Find line JVM_SUPPORT_RECOMMENDED_ARGS and add following line “-

Datlassian.recovery.password=temporarypassword”
Video Tutorial - Click Here



# Occasionally Atlassian Support may recommend that you set some specific JVM arguments.  You can use this variable
# below to do that.
#
JVM_SUPPORT_RECOMMENDED_ARGS="-Datlassian.recovery.password=temporarypassword"

Here “temporarypassword” is temporary password to open git in recovery mode, you can set  any suitable recovery password. 


Step 3:

After the update bitbucket setenv.sh file restart service  and open bitbucket server

/etc/init.d/atlbitbucket stop/etc/init.d/atlbitbucket start



Username:  recovery_admin
Password: temporarypassword

Note:  Bitbucket is running in recovery mode. You can log in as recovery_admin  using the password specified when starting Bitbucket - Bitbucket Server Recovery Doc

Step 4:

Change Bitbucket Server Admin Password : After successfully login on Bitbucket Server

Go to Settings → User → Administrator 

Click on Change Password and Update new password 


Step 5:

Now we have  successfully changed  admin password, Now we will disable bitbucket server recover mode
vi  /opt/atlassian/bitbucket/4.0.3/bin/setenv.sh

Find line JVM_SUPPORT_RECOMMENDED_ARGS and remove following line “-Datlassian.recovery.password=temporarypassword”

# Occasionally Atlassian Support may recommend that you set some specific JVM arguments.  You can use this variable
# below to do that.
#
JVM_SUPPORT_RECOMMENDED_ARGS=""



Bitbucket Recover mode disabled, Restart bitbucket service 

/etc/init.d/atlbitbucket stop/etc/init.d/atlbitbucket start

Thanks




No comments

Powered by Blogger.