Resetting a lost admin password


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

(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