The regular command to reset the password for a NextCloud user does not work when NextCloud is installed from a snap package.
$ sudo -u www-data php /var/www/nextcloud/occ user:resetpassword admin Could not open input file: /var/www/nextcloud/occ
The reason is that NextCloud is located in “/snap/nextcloud”
Unfortunately the occ file is not located in /snap/nextcloud/current/
However, you can run the nextcloud.occ command directly without specifying the path. Change admin to your user.
sudo nextcloud.occ user:resetpassword admin
Type in the new password twice and login.