I have succeeded in messing up /etc/sudoers and /etc/sudoers.d/sudoers. I can no longer access either of these files
Solution 1:
Remove the /etc/sudoers.d/sudoers
file.
Your sudoers
file is /etc/sudoers
. This is configured to source files in /etc/sudoers.d/
. The file giving problems for you is /etc/sudoers.d/sudoers
, which is normally not there. So I expect you will resolve the issue deleting that file.