Programster's Blog

Tutorials focusing on Linux, programming, and open-source

Jenkins - Admin Reset Password


It can be really annoying when you're locked and and forgotten your username/password, with no option to perform a password reset.

Generate Password Hash

The first thing we need to do is create a bcrypt hash to represent our new password:

Option 1 - If you have the PHP CLI installed, you can execute the following line in your terminal:

php -r "echo '#jbcrypt:' . password_hash('myPasswordHere',  PASSWORD_BCRYPT) . PHP_EOL;"

Option 2 - Use this online tool and fill in your password to generate a bcrypt hash before prefixing it with: #jbcrypt:.

Replace Config File

Navigte to your users directory and list them

cd $HOME/jenkins/users

Then edit the configuration file of the user you wish to set the password for. E.g.

vim programster_7682627586314307599/config.xml

Update the password hash to what you generated.


Restart Jenkins

Then restart Jenkins and you are good to go. This will either be:

docker-compose down
docker-compose up


sudo service jenkins restart


You should now be able to login using your user's username, and the password you just generated a hash for.


Last updated: 16th April 2021
First published: 16th April 2021