bitbucket-diy-backup Protecting the Admin User

As part of the setting up backups for bitbucket server using the atlassian-bitbucket-diy-backup ( it requires that you provide a system administrator account to the script. This account is used to put bitbucket in downtime. 

I see a security issue with this as it means that the username and password for an system administrator is stored in plain text on disk on the server.

Of course one can protect the file by giving it appropriate ownership and permissions. But is there not a better way?


1 answer

0 votes

Hi Jason! There are also other options, like for example you can create a token associated to the admin and then use this token for the backup. This token will still not be encrypted within the script, but it provides more security as it can not be used to access the instance. You can find this information at 


On the Authentication part:


Any authentication that works against Bitbucket will work against the REST API. The preferred authentication methods are HTTP Basic (when using SSL) and OAuth. Other supported methods include: HTTP Cookies and Trusted Applications.

You can find OAuth code samples in several programming languages at

The log-in page uses cookie-based authentication, so if you are using Bitbucket in a browser you can call REST from JavaScript on the page and rely on the authentication that the browser has established.

Hope this helps :)


Hello Ana,

Thank you for the reply, but sadly I am still confused.

You mention using a token associated to the admin account. I cannot find any evidence in the bitbucket interface of how to create this token. The link to the Bitbucket Rest API is not very enlightening. It seems that all the examples use username and password based authentication. 

I took a look at using the other recommended method: Oauth. Sadly this didnt go anywhere because the oauth based authentication requires a application link url. (see step 2 at oauth) and I am not using an application, just the atlassian provided backup bash script. 

This script does not have a url associated with it.

Could you please point me in the correct direction ?



Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 14, 2019 in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder :  #!/bin/bash source "$(dirname "$0")/" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables R...

297 views 0 12
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you