Generate a replacement administrator password

I am seeking to replace the admin password by replacing it in the database.

So my password is … W*hA^oHs9q&C2#EdxsDi7oU5eI7FJXkMv@tSbPT

Is it possible to change that into some format that is understood in NC?
All other opensource applications I use have the ability to complete this and it is provided in the documentation

For example Joomla provides d2064d358136996bd22421584a7cb33e:trd7TvKHx6dMeoMmBVxYmg0vuXEA4199 which translates to secret

So I use that to access the admin and change the password.

Can someone supply something that can assist me here please … pretty please?

I don’t understand what you want to do. Joomla and also Nextcloud are storing passwords in a hashed format. A hashing mechanism is always a one-way ticket so that it isn’t possible to extract the original password from a hash.

It would be a lot simpler to use the

occ user:resetpassword admin

command.

Agree but you still should be able to add the hashed password as a short term solution.
can do the same in Wordpress and more

Absolutely correct but sadly useless.
I don’t have shell access, hence my question

Do you have access to the cronjob configuration or can you execute SQL commands?

Simply I wish to put a password of any text to place in the database via phpmyadmin in a form that NC accepts

Why my issue
I cannot install the latest version of NC on my shared server in SiteGround.
NC refuses to update and a clean install times out
I can install on my mac/mamp install and all works fine except for the password when shifting across.
Have been using NC for some time but upgrades are getting unacceptable when they refuse to do that and a total reinstall needs to occur. Little or no help here. /rant
Nothing personal with that rant
Where I am at is I cannot login as admin.
No SSH or command line access.
How will cronjob help?
I have phpmyadmin access so if there is a command I can run there i bow down to your wonderous skills
Thanks

Just install the OCC Web App
https://apps.nextcloud.com/apps/occweb

Ok so where to download , install and execute that?
Remembering I have NO administrator access to NC.
Excuse my ignorance

Some hosters allow to setup cronjobs which can be used to execute commands, like e.g.
occ user:resetpassword admin. The password can be parsed using the environment
variable OC_PASS as described in the command help.
Additionally you might have seen that all passwords, which are stored in the table oc_users,
have been generated using bcrypt ($2y$10$…). So you could try to generate a replacement
password on a different machine using the htpasswd command.

In that case you need to contact your administrator.

Thanks j-ed.
I will try again on my local server
Am at my whits end here
Way too much time wasted with this latest.
If this is what will happen moving forward then sadly NC is becoming a bridge too far.
I love it … simple upgrade maintenance like this is just not on.

I think its time to admit that the upgrade process for a system as complex can’t be done through the web frontend itself in a reliable way. The dev team should either deliver or officially give up on this promise as it obviously means stuck users and data loss!

1 Like

Well put @Escubaer
I’m unsure as to what has changed to cause this although with each update it appears to get progressively problematic.

if you do have access to the database, just update the record with the new passwd you want( in a MD5 mode to crypt it)
UPDATE oc_authtoken
SET password = MD5(‘hellohello on rentre du boulot’)
WHERE login_name = ‘yourcnxname’

Use this:
https://apps.nextcloud.com/apps/occweb

Given up on this.
@Escubaer nailed it.
When a plain vanilla new install does not install there is some issues that need addressing, whether on my own server or shared space.
Having this issue is now of concern on 5 client servers where we’ve had no issues up until now. For now we will leave the installs out of date until this is resolved (we hope) or go to an alternative. I really hope the former.