MacMini M1 broken sudo
So, for those coming across this wanting to avoid re-installing... the M1 doesn't have a "Single User Mode", but booting into recovery (hold the power button when you start the machine) you can open Disk Utility and mount the "Data" partition that's next to your OS partition. Then close Disk Utility, open a terminal and run the following: (not sure if you'll need the "\ 1", but I did)
vi /Volumes/Data\ 1/private/etc/pam.d/sudo
and make it match this:
auth sufficient pam_smartcard.so
auth required pam_opendirectory.so
account required pam_permit.so
password required pam_deny.so
session required pam_permit.so
Then just reboot, and you should be good to go 👍