Resetting or recreating admin user

Hi,

I have an OCIS installation. The initial admin user has been renamed to other name ex. NewAdmin
However, we lost the password for the NewAdmin.
I have try to run the idm resetpassword command but it gives an error

./ocis idm resetpassword
Resetting password for user ‘uid=admin,ou=users,o=libregraph-idm’.
Enter new password:
Re-enter new password:
Failed to update admin password: entry does not exist
Password for user ‘uid=admin,ou=users,o=libregraph-idm’ updated.

After running the above command, it seems that the admin password was not updated.
Is there any possibility to generate back the admin user with initial password ?

Hello nik,

thank you for your request. Looks like you found the bug. I created bug 9474 and we’ll try to solve as soon as possible.

Please try to see the password you created in the $HOME/.ocis/config/ocis.yaml idm->service_user_passwords->admin_password

1 Like

i have tried to login after the idm resetpassword but it does not recognize probably because it tries to find the ‘admin’ user but couldn’t find it. my guess if the logic program is to find the ‘admin’ and not the user identifier. since i have already rename the admin to another name, the program couldn’t find the ‘admin’ anymore thus the whole change password process does not complete properly.

if the program uses the admin_user_id identifier it might be able to change the password eventhouh the name is no longer ‘admin’ as the idenfier is still the same. This is my guess.

Yes, by default it finds admin

Now it is possible to specify userName in the resetpassword command

use please:
ocis/bin/ocis idm resetpassword -user-name NewAdmin
or ocis/bin/ocis idm resetpassword -u NewAdmin

this change is available in the owncloud/ocis-rolling:master. On 05.07.24 it will also be available on owncloud/ocis-rolling:latest

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.