Password lost

How to change the lost password?

I had no new onboarding flow during the first start. System asked for the user and password, which I used testing auth in pervious versions, but I lost both.

Not sure if this works in 0.77.
Rename your config/.storage folder to .storage.bak and restart HA.
Clean the cache of your browser.

I’m have HA on MAC and can’t locate such folder.

Should be in the same folder where your configuration.yaml lives.
With the point at the beginning the folder is hidden.
Don’t know how to show hidden files/folders on mac.

Greta it’s work .
Thank you a lot

I made a few tests with hass.io 0.76.2 and 0.77.0b4

You have to:

  • Stop HA (Services -> homeassistant.stop)
  • Rename or delete the .storage folder
  • Clean your browser cache and close it, also delete some cookies you have from HA.
  • Start HA, you’ll get the Login to create an user account
  • Login with that user

I had to restart the browser and login three times to get the “Save login” popup. (Firefox)

Maybe helps others.

1 Like

It works, thanks a lot.

A better way to do this is to

  • remove .storage/auth*
  • remove .storage/onboarding

There is no need to delete the entity registry and other configurations.

2 Likes

See also the documentation.

1 Like

Where is this .storage located? I could not find in in Windows explorer.

config/.storage is a hidden folder. You will have to enable “Show hidden folders” in folder options.

I just came across this problem with my setup, forgot my password.
There are a couple of ways to reset your password without needing to recreate your user.
First way:

  1. Log in using the legacy password. (set in configuration.yaml)
  2. Create a new temporary user.
  3. Shutdown HA and edit auth_provider.homeassistant in /usr/share/hassio/homeassistant/.storage (on debian hassio), copying the test user’s password to your own.
  4. Startup HA and log in.
  5. Delete the temp user.

Second way (suggested by u/sweharris on Reddit)

  1. Log into HA system using ssh
  2. Enter HA environment. (I do this with ‘docker exec -it homeassistant /bin/bash’)
  3. Start python.
  4. Enter the following.
    import bcrypt
    import base64
    password=“hello”
    hashed = bcrypt.hashpw(password.encode(), bcrypt.gensalt(rounds=12))
    hashed = base64.b64encode(hashed)
    print(hashed)
  5. Shut down HA
  6. Replace your password in auth_provider.homeassistant with the password you got from python. (you want the part between the single quotes)
  7. Start HA and log in.

I used the first method to get my ID back and I tried the second on a test ID to see if it would work. (it does!)

Hope this helps anyone else having a lost password issue.

2 Likes

[skywise], this is genius! thank