I’ve lost my admin password the other day (lpass cli issues… meh) and after looking through the documentation, I see that you can reset it using “occ user:resetpassword admin”.
I tried logging into nextcloud after resetting the admin password with no luck. It seems to be updating the database as I see the encrypted password column change everytime I run it, so I’m not sure what’s going on.
DB - 10.0.36-MariaDB-0ubuntu0.16.04.1
Server - Ubuntu 16.04.1
NextCloud - 15
You need to run the occ command in the directory where nextcloud is installed, and as the user the web server is running. Did you do this? With Ubuntu the user would be www-data. So the complete command is:
cd /var/www/nextcloud
sudo -u www-data php occ user:resetpassword admin