Resetting a lost admin password

Hello,

I don’t remember the admin password. I want to reset. The method below doesn’t work. How can I reset the admin password?

$ sudo -u www-data php /var/www/nextcloud/occ user:resetpassword admin
sudo: php: command not found

https://docs.nextcloud.com/server/22/admin_manual/configuration_user/reset_admin_password.html

(I did the Nextcloud installation from the Ubuntu startup installation. SnapCraft)

Write out the full $path to php. Something like:

sudo -u www-data /path/to/your/php /var/www/nextcloud/occ user:resetpassword admin

1 Like