Recently I forgot the password of my Contao (https://contao.org) admin backend user. To regain control of the content management system, I had to reset the password for user in Contao database.
All backend users and their credentials are stored in the Contao database in the table tl_user. The password is saved in the field password via a SHA1 hash. That’s why I used my little Python script described under https://www.ask-sheldon.com/linux-apache-protect-directory-with-username-and-password/ to generate a new SHA1 Password hash and inserted the value into the password field via phpMyAdmin.
For example, this is the hash for “AskSheldon”:
0e94807baa483d3fa4b4a8ff0c0cd0ec8e26d528
That’s it! Afterwards I was able to login again.