Reset password for login

I forgot the password to login to dietpi. Is it possible to get around the problem? Such as?
Thanks 1000

P.S. it is so stable that installed a year ago on raspberry (2B) I never had the opportunity to integrate and I forgot the login password

The hashed password is stored in /etc/shadow.
The hashed password is the entry right after the username.

username : hashed password : last change of password : min : max : warn : inactive : expire

So you could try to crack it with tools like hashcat or john the ripper, which will maybe take a loooong long time.
Or you grab the default shadow file from the DietPi image and copy it over onto your SD card, which should restore the password to default? I’m not complete shure if this works, unfortunately I can not test this right now.

I did a bit research and found other solutions:
If you want to set no password, don’t remove the hash in /etc/shadow. Instead go into /etc/passwd and remove the “x” from the line which starts with root, like:
root:x:0:0:root:/root:/bin/bash → root::0:0:root:/root:/bin/bash

After rebooting and log in, just type sudo passwd root to set new root password.

When you can still login as root:

chpasswd <<< 'dietpi:yourNewPassword'

I guess that’s the issue, OP can’t login anymore. Probably this could help a bit

Ah lol, I read “login as dietpi” and “1000” (the UID of the dietpi user) while it was “login to dietpi” and “thanks 1000”.

That link is a good option, then from within the shell you can adjust the password of any user.