Owner change

Hello,

Not sure if there is a topic for this already, but here goes.

For anyone who has lost owner account access or has previously deleted the owner account, I discovered a way to update/change the account viewed as owner by home assistant.

You will need to install and configure SambaShare. Once the add on is running, download and open X-plore from the app store on your android device. I am unsure if this application is available on iOS.

Open the app and scan your LAN for servers. Home assistant will appear I n need the list. Click on it. From there click on the config folder. Make sure you have gone into app settings and turned on show hidden folders. Open the ‘auth’ file using X-plore file editor. Once open, scroll down until you find the user you wish to make owner. Change 'owner: false, ’ to ‘owner: true,’ and save the file. You will be asked if you want to save the file to the original location. Select yes.

After this, you will need to restart home assistant. After rtart, the account will now be listed as owner.

This process has only been tested on Hass.io. not sure about success with other installation methods.

6 Likes

I am also curious if this is feasible.

Confirmed, this works on Home Assistant Supervised on Debian 10. Thanks!

I’m using the Home Assistant Blue and MacBook Pro, and this info got me nearly to what I needing. I needed to change a “username” that was misspelled. Here are the steps I took, in case they can help anyone who gets here after me.

01. Setup "Samba share" from the Supervisor.
02. SSH into your Home Assistant device.
03. Type - "cd config/.storage"
04. Type - "nano auth"
05. Fine the username I need to edit, and change it.
06. Press - "CTRL + O" -> "Return" -> "CTRL + X"
07. Type - "nano auth_provider.homeassistant"
08. Find the username, and change it.
09. CTRL + O -> Return -> CTRL + X
10. Type - "ha core restart"
11. Type - "exit"
5 Likes

Why the samba share if you’re going in with ssh?

1 Like

That’s how I setup the SSH on my device. Is there a better way? I’m extremely new to all this.

Oh, I’m not familiar with how the HA Blue works, maybe that’s how you activate ssh, but that’s strange.

Samba is a way of creating a network share for a folder using SMB. So you’d typically open your explorer and browse to //SERVER_IP/SHARE to see and edit the shared files.

SSH is a way to get a remote command line.
You can then do nano or vim to edit files, like you did.

Hi everyone. I’m new here and I’m trying to change the “Owner” user. I’m Administrator but I need to cancel the previous “Owner” and become the “Owner” myself. Is there an easy way to do it? I’m doing my best but it’s so hard for me to manage this application.
Thanks to everyone who’ll help me!
:hugs:

There is a file you can change “/config/.storage/auth”
This file has settings for each user in it. Find the section with the user account you would like to be an owner.

Simply change the line "is_owner": false,
too "is_owner": true,

4 Likes

Hi Francis.
I do not have the file you are mentioning “/config/.storage/auth”
Where can I find it?
I can log in with the user account if this could help.
Maybe I can simply change user name and display name? I can also change the settings in the configuration menu / entities? and also in the developer tools menu / states?
I really sucks at this :pensive:

it should be there. .storage is a hidden directory, maybe that is the problem ?

image

Ok, after several attempts I finally made it!!! Thanks for your support!!
I think I’ll be back soon with other questions!

1 Like

Thanks for the detailed instructions. I followed your steps starting at 3 after using Terminal within the HA web client. I wanted to change my username. After the restart I it auto-reconnected and resumed being logged in with my previous username. I scrolled down the sidebar and clicked on my profile name, then scrolled around to find the logout link. Then had to use the new username to log in.

1 Like

Here’s what I did when I lost access to the owners account (forgotten password) - might be of use to others looking at this thread.
Luckily I had another admin account (say user2) so logged in using that.
Using Terminal & SSH add-on navigated to config/.storage
Used nano to edit auth_provider.homeassistant, copying known user2 password to that of owner.
Saved, rebooted and all good

I encounter a problem when I try to make a user an owner.
When I open the aut file and change the line “is_owner”: false, too “is_owner”: true, this works. I save the file (close it and reopen it to check) everyting looks okĂ©.
Now I go into HA and I see that the user is still not an owner. Then, when I go back to the aut file, open it again I see that the ‘is owner’ automatically has changed back to false again.
Does someone know what I do wrong (how to make the user an owner)?

Update: I tried the method with SSH and this worked like a charm. So I do not know why it did not work using the windows file editor with Samba Share
 but problem solved with SSH.

Thans @PixelRubble this works great even inside of HA with the SSH add-on :slight_smile:

Thanks @PixelRubble this was a life saver as I had locked myself out of my Owner account.
The I’m locked out page was only half of the answer for me as an admin can’t reset the password of the owner.

By using the steps you described + using the Terminal &SSH add-on I was able to temporarily switch the owner status over to the temporary Admin user I created.
Logging in as the temp user I was then finally able to change the password of the real owner.
After that I switched the owner status back.

Everything worked as a charm.

Thanks again

Had exactly the same issue. Did what you suggested but created an additional pair of users with different passwords and tested by copying the password: line from one user to the other so that they would have the same password. After a restart (settings | system | restart home assistant), I was able to log into both users with the same password (success!). Only then did I have confidence to copy a known password line to the owner user and reboot. Now I have all my passwords in a password database.
Incidentally, there is a HA page called “I’m locked out!” which advises to log in to the HA instance with the terminal (& SSH of course) and use the command
auth reset --username existing_user --password new_password
to change the password. This did not work and gave me the error
zsh: command not found: auth
So I kept searching and found this answer.
Thanks!

Have you been able to RENAME THE OWNER ?

This does not work for me in the way you had described it even though i have even restarted HA by a reboot each time.

After changing the username from abc to ab in both files I was no longer able to enter the system neither as ab nor as former abc .
I always got a message that password or user were wrong.

I went forward and tried a lot of things like creating a new user , giving that one the Owners privilege and admin rights but once everything is done and i had logged out I was able to log in but THEN the in systems - PERSON the 2nd owners tab called users was missing as you can see here

I do not know what to do and how to get the system working as planned cause too much effort went into building this system up in the hope that I would finally be able to solve the mystery from the beginning, the wrong username.

BUT: there is a hidden way to get access to that content , this user view

You need to enter the proper url for that site which means to replace /person by /users

https://192.168.yyy.xx:8123/config/users

But how long will that feature be open this way ?

Therefore any proper way to rename the owner and admin will be appreciated cause I do not wanna go with those risks involved like only a hidden function to add a new user through a backdoor.

thanks