Blog Post

Umbraco - Recovering administrators password

Monday, June 26, 2017 3:11 PM

I have been given project website, for which I have been given no username/password. I have searched internet for the best way. I Have argued, someone had to have the same problem.

I have found two solutions

  1. SQL
  2. DLL

SQL

I have found couple sites which recommended SQL Query to update database to specific hash. 

Had it work?

No, reason for that is the structure has changed. In older days I was I presume containing password only (based on you membership configuration either stored as Hashed string or as Clear string. You can check your configuration in web.config. 

Note

If you store your passwords in clear text you have possibility of someone stealing your user data (usually through SQL injection). After then they may shared on internet. 

 

DLL

Searching a little more has revealed that umbraco developer projects contain Umbraco admin reset package.

The outline is 

Simple project that allows reset of the admin user(user 0) username and password by adding the UmbracoAdminReset.dll to the ~/bin folder of your Umbraco installation. Handy when you inherit a site and didn't receive the credentials.
Username will be reset to Admin and password to Admin1234!
During the startup of the site UmbracoAdminReset will reset the username and password, will make sure the admin user is unlocked and will delete itself afterwards so you can login and change the credentials yourself.

I have used this package myself, and it worked like charm.

How did I make it work?

I have checked the database (used connection string from web.config) what is the first user in database (I do not want to override client users). Lucky for me I had no need to move records about as my user was the ADMIN. 

While recovering password for the admin account, I have SQL query which is showing me UserName & Password (Hashed). On my other window I have file list with ~/Bin folder open.

Then, I have stopped the website and tested by browsing to that untill I got 404 page. It took about minute also.

I have followed by uploading the file into ~/Bin folder.

And restart of website.

The file does disappear. Does this means my password reset has been successfull? 

I have rerun my SQL command in another window and I can see the password is different and UserName has been updated to Admin.

Now I am able to login with Admin1234! password. 

 

Do not forget to change the password to something else ! If you do.