Search code examples
bashsudosudoers

error in sudo config, need help to fix


My shell give me this error when trying to do a sudo

/etc/sudoers: syntax error near line 30 <<

I did not modify this file...

anyway the 30th line is the very end of the file. I paste here the last 3 rows, from 27 to 30

# See sudoers(5) for more information on "#include" directives:

#includedir /etc/sudoers.d

please help me to understand the problem and fix it. I am a newbie on linux.


Solution

  • If the 30th line is the last one it might indicate that you have problems in the file somewhere along the way.

    The parser has reached the end of the file and is telling you there is an error (might be looking for unclosed brackets of any kind etc).

    If you can parse the full file or try to read it and go line by line to figure out where is the error.