Reset admin password, snap installed

I just installed Ubuntu server and Nextcloud, but i misspelled my password and now i cannot access it (it contains no files though).

I do not receive an email from “forgot my password”, even though I entered the information before logging out.

I want to reset the password through the terminal, but I cannot manage to get it right.

I’ve tried the following command but the file does not exist.
sudo -u www-data php /var/www/html/nextcloud/occ user:resetpassword admin

I’ve tried running the command om various OCC files (like the follow commands), but nothing seems to work.
/snap/nextcloud/31751/bin/occ
/snap/nextcloud/31751/htdocs/occ
nextcloud.occ

Does anyone have an idea how to reset the admin password with on nextcloud installed with snap?

1 Like

Not sure offhand the occ command required to reset the password, but assuming your first attempt was correct, for the snap it’ll look like this:

sudo nextcloud.occ user:resetpassword admin
3 Likes

Huge thank you, it worked!

2 Likes

Yes, Thank you very much, its worked for me.