PowerDNS Admin reset lost password

PowerDNS Admin is a powerful web administration tool that we use for easily managing domain zones on our PowerDNS servers. Although PowerDNS Admin offers extensive features it lacks a “lost password” feature. So if you happen to lose your password, you are forced to reset it via the command line. In this tutorial, we’ll show you a way to do this.

The “htpasswd” generator required to create a new “bcrypt” password is part of the “apache2-utils” package which needs to be installed on your system.

# apt install apache2-utils

Create the new password.

# PW=$(htpasswd -bnBC 15 "" Your_New_Password | tr -d ':\n')

Obviously you need to replace “Your_New_Password” with your own new password.

You can view the password to use for comparison at a later stage.

# echo $PW

List the PowerDNS Admin users stored in the “powerdnsadmin” database.

# mysql -e "select * from powerdnsadmin.user;"

Check the “id”number of the user for which you need to reset the password. In our case “1”.

Update the database with the new password.

# mysql -e "UPDATE powerdnsadmin.user SET password='$PW' WHERE id='1';"

Check the record and see if the password matches.

# mysql -e "select * from powerdnsadmin.user;"

Now we should be able to login with our new password.

Similar Posts