Segmentation Error on Sudo

I edited my sudoers file correctly as far as I know using the command " sudo nano /etc/sudoers"
and after I saved it I cannot use my sudo command now .
Everytime I try to use sudo command it says ‘Segmentation error’ and now I cant go to root also when I try the command
it asks for password and says
Authentication failure


Welcome @Binod-BK,

Please be careful and check files for comments before directly editing.

Found at top of /etc/sudoers:

└──╼ #cat /etc/sudoers

This file MUST be edited with the ‘visudo’ command as root.

Please consider adding local content in /etc/sudoers.d/ instead of
directly modifying this file.

See the man page for details on how to write a sudoers file.

When I run visudo it says permission denied and when
I run sudo visudo its the same
segmentation fault

Try selecting recovery mode at boot and repair it from there.

EDIT: In recovery mode you should be able to drop right into root shell (do not need sudo command to do so).

I just tried it. And it also didnt worked.
When I run the command
sudo whoami
after the recovery boot it said segmentation fault.

  1. Boot into a live session of Linux (off Parrot USB or otherwise).

  2. Mount the harddrive /etc containing your sudoer file.

  3. While in this live session you can edit the mounted /etc/sudoer file by specifying the file using this command:

  4. sudo visudo -f /mountpoint/etc/sudoers

Replace /mountpoint above with your mount point used.