Saturday, October 11, 2008

Always use visudo to edit the sudoers file

A syntax error in the sudoers file can prevent you from using sudo to gain root privileges. If you
edit this file directly (without using visudo), you will not know that you introduced a syntax error
until you find you cannot use sudo. The visudo utility checks the syntax of sudoers before it
allows you to exit. If it finds an error, it gives you the choice of fixing the error, exiting without saving the changes to the file, or saving the changes and exiting. The last is usually a poor choice, so visudo marks the last choice with (danger!).

No comments:

Post a Comment