Forgotten owner/admin username, solvable from command line?

I had some issues with the update to 115.2 today, so I had to remove the browser history for home assistant. It solved the issue but damn, I realized I forgot the owner/admin username. I only have non admin access at the moment.

I am running my HA as a VM on unraid, so I am able to access the command line for logging in as root via the VNC remote. So I can change password of a user but I don’t know the name of the owner/admin user.
Is it possible to add an admin user from the console?
Or is it possible to delete the authentication data when logged into the console?

Really desperate for some support, I don’t want to start over with a new HA setup.

1 Like
1 Like

Thanks, but I have already read it a couple of times. When I get in to the VNC I get directly into HA login page and login as root. But then… I have only found out how to reset user I know the name of.

If you have SAMBA access delete the files I linked to.

No, unfortunately haven’t I set up SAMBA or SSH for HA yet

Can you access the file system through the VM?

Well, I have been able to get some kind of access by using the command “login” when I have accessed the HA console. But I have not been able to find the HA config folder, the keyboard setup is wrong so I haven’t been able to use the “~” key.

Btw, thanks for supporting!

Sounds like are logged into the host system, not the home assistant container.

That could be right, when I try “docker ps” it lists 10 dockers

I gave up after struggling for a day without any success and reinstalled the VM

Just went through the same thing. Documenting here for future use.

If you have physical access to the instance VM/Pi etc from the ha > command line you can;
login
(to access the HASS linux subsystem)
docker ps
(to list the dockers that are running as part of HASS)
docker exec -it XXXX /bin/bash
(use the first X chars of the Homeassistant Docker Instance id listed above, to access the specific Homeassistant docker instance linux subsystem)
cat /config/.storage/auth
(this will output all the configured users in your instance)
exit
(the docker instance)
exit
(the HASS instance)

Now you can
auth reset --username "ZZZZ" --password "abc123"
to reset the password of the user you found in the auth file above.

11 Likes

This just saved me. The steps you outline should be included in the “I’m Locked Out” info. Thank you!

1 Like

There is an error message issued when using the “-it” in the docker command, and the “exec” functionality is not possible. Has this been removed since?

Thanks, this should definitelly be added to I’m Locked Out page.

It’s already there: https://www.home-assistant.io/docs/locked_out/#to-reset-a-users-password-via-console