Skip to main content
Kill -9 Club
Sign in

visudo

AccountsPackage: sudo

Edits /etc/sudoers and checks the syntax before saving. A typo in that file takes sudo away from everyone, including whoever could fix it; this is the only reasonable way to change it.

What its options do in the lessons

From the same glossary the lessons render under their commands, so the two cannot disagree.

visudo -f
Edits a file other than /etc/sudoers — a fragment in /etc/sudoers.d/checking its syntax before saving. That check is what stops you locking yourself out.
visudo -c
Checks without opening an editor, and exits non-zero if the syntax is wrong. This is the form for validating a file already written, or from a script.

Lessons that teach it