How to change user's password

After recent iOS app on my girlfriend mobile phone, it’s asking for authentication. But we don’t remember the password.
How can I change the password?
Obviously I have access to console, but ha auth reset command ends up with:

this command is limited due to security reasons, and will only work on some locations. For example, the Operating System terminal

BTW when in console, login command asks for credentials. I was sure it didn’t ask for anything in the past. If I enter root it returns to CLI prompt immediatelly after several seconds. If I enter other login name (ie my HA login) it asks for password but my HA credentials doesn’t match.
Can you give me some cues, please?

In the console of the host, the only user account available is “root” with no password.

Once you log in there, as you seem to have been able to before, enter:

auth reset --username existing_user --password new_password

Where existing_user is the name of the account you are trying to reset, and new_password is the new password.

1 Like

thank you, so why I get this:
obrazek

and this:

Next version of HA does allow passwords to be changed in the UI.

You’re getting that message and it’s not working because you’re trying to do this over SSH.

You need to be at the local console. If this is installed as the OS, attach a keyboard and monitor to your Pi (or NUC, etc).
If it’s a VM, those typically allow console access, you have have to google how.
If this is a Supervised install on another OS, there’s a way to do it but I don’t recall how unfortunately. I’m sure it’s been covered on this forum previously, you might be able to find it by searching.

Or as @Dansker said, you can wait until Sept 17th when the new version of HA is out, then you can do it via the GUI.

I think you can delete your gf’s username and re-add it.

In short to change pwd of other user (while I’m admin) I need physical access to the server.
I’ve never seen such level of security in my whole life. Maybe in movies. It’s sick.

btw: what security since removing and re-adding user does the job? It’s a bad joke.

Thank you all for clarification guys.

Do you know why login root command doesn’t move me out from cli?

2 Likes

I am a new Home Asistant user and also forgot my Owner password. I discoverd that I had forgotten my password when I installed the MacOS desktop client and couldn’t login to that. Luckily I was still logged in to the web gui and here is how I managed to get ‘restore’ my owner password:

  1. Created a new Admin user and set a basic password and logged out as me and in as the new temp admin. This was in a ‘help’ page for recovering lost Owner password but the new Admin user has no rights to reset the Owner password in the gui (at least not that I could find).
  2. Login via ssh to the OS. I use a docker container on an Ubuntu 20.04 VM.
  3. Login to the homeassistant docker container: e.g. docker exec -it 7c1c652821a8 /bin/bash
  4. cd to the .storage folder
  5. Ran a grep <username> *
  6. Found that the file auth_provider.homeassistant has the password hashes in it.
  7. Edited that file and copied the password hash for the new temp user I created and replaced the password hash for my user.
  8. Went back to the HA gui and logged out as the temp user.
  9. Tried logging in as me and it worked using the password that I had set for the temp user.

I hope this helps others and is clear enough. If not then send me a message and I’ll see if I can help.

NOTE: I am a newbie HA user so my knowledge on this is basic but I am a longtime linux admin so can help on that side.

Cheers

EDIT: typos

6 Likes

[I’m using the `haos_rpi4-64-6.4.img.xz` image.]

@skewbie : thanks for the suggestion, but it didn’t work for me.

Making use of the Home Assistant Community Add-on: SSH & Web Terminal version of SSH, I logged in via SSH.

I then used docker container ls to list the containers, followed by docker exec -it <homeassistant_conatiner_ID> /bin/bash to log into it.
I did the grep and found the file you found. I then copied the new user’s hash to my old user and saved. I confirmed the change using cat. However, whilst I’m still able to log into my temp account, I am unable to log into the Owner account. I did not restart my HA at this point, which may have made a difference. Otherwise, it is possible that salt has been added to the hash?

What I did next worked though:

Whilst still logged into that docker container, and as per the instructions at I’m Locked Out! :: To reset a user’s password, via the container command line, I used:

hass --script auth --config /config change_password <my_username> <new_password>

to change the password. At first this did not work (see my comment above) but after restarting HA, I was able to log in.

Thanks.

You only can do this in the UI when you are logged in as owner.
If you are not the owner of the installation there is no reset password option.
If you want to reset the password of the owner account do this.
Tested on Version 2022.7.3

Login via console;

Enter next command
auth reset --username existing_user --password new_password

Where can one find which account is the owner? It doesn’t say in the user list.

Are you looking in the correct spot? It definitely lists the owner in the group column.

I didn’t have an owner account in the list so I must have removed it way back.

I actually found a thread explaining how to fix this. Edit /config/.storage/auth to set an account as owner and restart Home Assistant.

You can certainly do change a users password in the UI circa 2023

/config/person > People > Click person

Last three options are “Delete | Change Password | Update”

… and the option has now gone. Less than 4 weeks later? :upside_down_face:

No its not gone.


I swear it was here… anyone know?

It is for me.

Try cache clear?

It appears you need to be logged in as the “owner” and not just an administrator.

5 Likes