How do I fix a syntax error in the sudoers file?

July 31, 2025 3 answers
Asked by CuriousCat99
I'm having a tough time running commands in the terminal because I'm getting a syntax error related to my sudoers file. It specifically mentions a problem at line 60, character 36. I'm not sure how to resolve this issue. Any help would be appreciated!

Answers

ErrorDecoder
Just to add, that reference to '60:36' indicates line 60 and character 36 in that line. If you need to locate the error, this can help you pinpoint where to look in the file.

CuriousCat99: I doubt I could find the error. Don't feel like I'm versed enough yet. Thank you!

Reply to this answer
LinuxWarrior42
Exactly, if the sudoers file was modified without a verification tool, you're likely facing this issue. Recovery mode or a live USB is indeed your best bet to get things back to normal.

CuriousCat99: It must have happened by accident because I wouldn't edit the sudoers file with my poor skill level. I'll give the USB boot a shot. Thank you!

Reply to this answer
TechSavvyRogue
It sounds like you edited the sudoers file without using `visudo`, which is a tool meant to help prevent syntax errors. You should boot from an installation ISO or a live USB to get into recovery mode and fix the file.

CuriousCat99: Not on purpose, that's for sure. I will try to boot from the USB. Thank you!

Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions