home-assistant / home-assistant.io

:blue_book: Home Assistant User documentation
https://www.home-assistant.io
Other
4.58k stars 7.11k forks source link

Update the lost password documentation when using ha in a container #31076

Closed juque-jqx closed 3 months ago

juque-jqx commented 5 months ago

The problem

Hi, I've encountered an abnormal authentication problem on my home assistant instance running with docker.

I wanted to connect via the site in the usual way, with my credentials stored in my digital safe. This fails even though I haven't made any changes related to authentication. (User who owns the instance)

I've managed to fix the problem, but in a roundabout way. The help provided in the documentation didn't work . I don't know if the documentation is out of date or if this is a bug introduced in the latest versions of Home Assistant.

I was able to connect to the console of my container with : docker exec -it homeassistant bash

However, the following command: hass does not allow me to continue, whether the container is started or not.

The following command couldn't find my user, even after checking that the username corresponded to my owner: hass --script auth --config /config change_password existing_user new_password

Here's what I did to correct the problem:

My owner was still logged in on the phone. The change password interface wasn't working. I had a non-existent password message if I recall correctly. So I tried to create a temporary administrator user, to see if this could change my owner password. But it didn't.

I applied the solution found here Thanks to @ayeulC

In my hass/.storage/auth_provider.homeassistant file I only had my temporary user created, but nothing for my owner, nor for my partner's user:

{ "version": 1, "minor_version: 1, "key": "auth_provider.homeassistant", "data": { "users": [ { "username": "test", "password": "hashPassword" } ] } }

So I added a block with my user and gave it the password hash hello:

{ "version": 1, "minor_version": 1, "key": "auth_provider.homeassistant", "data": { "users": [ { "username": "myUser", "password": "JDJiJDEyJG5QMWN2NEhpSzNQZkJYMVR6NWE4Ry5lamI2MGhMLzU1U2NhSlAzL09uZURDb01VMVNGQ1NX" }, { "username": "test", "password": "hashPassword" } ] } }

from there I was able to connect with my user with the hello password and then change his password.

What version of Home Assistant Core has the issue?

core-2024.1.5

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

No response

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

github-actions[bot] commented 3 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved. If this issue is still relevant, please let us know by leaving a comment 👍 This issue has now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.