I corrupted my sudoers file - how to modify from it from single user mode
Hello
by mistake, I corrupted my sudoer file, i modified it, and mis-spelled a word that corrupted the file
I wrote NOPASSED instead of NOPASSWD.
in the meantime, I am not able to edit it any more.
I am using MacBook Pro (16-inch, 2021), OS 12.3
I rebooted with single view mode, and opened the terminal, but i wan not able to reach that directory to modify the file. any help?
##### This log below is from the normal terminal OS , not from the single user mode #####
oahmed@oahmed-mac /etc % ls -l | grep sudo
-r--r----- 1 root wheel 257 26 Feb 02:05 sudo_lecture
-r--r----- 1 root wheel 1573 2 Feb 12:18 sudoers
drwxr-xr-x 2 root wheel 64 26 Feb 02:05 sudoers.d
oahmed@oahmed-mac /etc % more sudoers
sudoers: Permission denied
oahmed@oahmed-mac /etc % sudo vi sudoers
/etc/sudoers:56:34: syntax error
%admin ALL = (ALL) NOPASSED: ALL
^
Password:
Sorry, user oahmed is not allowed to execute '/usr/bin/vi sudoers' as root on oahmed-mac.