Resetting password through console

I have tried to use the commands that are posted on their website and other websites and it isn’t working it just says directory not found. I use the same password fore everything so i don’t forget there is no way that I would have changed it, when I type that password in it says its wrong. I have a lot of personal photos and files on my next cloud server that are just lost now. Does anyone have a solution?

Do you mean Nextcloud and the occ-command? Have you read this. Use the correct path for your Nextcloud. Please post the command you have executed and the error.

They are not lost. You can find them under /path/to/your/nextcloud/data/username/files if you have not activated server-side encryption. As a beginner, you should probably not activate it either.

Thank you for letting me know about my files I was able to remote in with filezilla and transfer them to my personal pc for now.

You must use sudo and not su (see eror in your screenshot). If you use Debian maybe you must install the package sudo. If all not you must change to www-data and execute it from www-data directly. But mostly the account is not direct usable.

In case you have to use su because sudo is not installed on your system, you need to preserve the environment of the current user with the -p option, because www-data doesn’t have an interactive shell. You also have to add the -c option in order to run a command as a different user:

su -p -c - www-data "php -f /var/www/nextcloud/occ user:resetpassword youngaglet"