Locked myself out after enabling misconfigured Google Authenticator I somehow managed to lock myself out of a Drupal 9 installation after setting up TFA with Google Authenticator login. So, i know my user1 name, my user 1 password, but TFA doesn't allow me backend access, because the app is misconfigured. I still have FTP, DB and SSH access.
I already did this two years ago on another site. That time I added a line to settings.php that granted admin role to anonymous user. But I cannot find this solution anymore.
Any help would make my day!
I post this as an answer, because someone might be as stupid as I am :)
I browsed various old backups and found the settings.php line that grants admin permissions to anonymous user, and it worked.
If you add:
$config['user.role.anonymous']['is_admin'] = 'true';

in your settings.php, every anonymous user is admin. That way I could get back into admin panel and uninstall TFA and Google Authenticator. Deleted the line, logged back in as user1 and installed both modules again.
Handy way to do it, if you don't have drush. But not recommended for production sites obviously.