About

The sudoers file typically is found at the default location /etc/sudoers and holds the security polices for the sudo command.

Note: Most current Linux distributions are moving away from a single sudoers file and strongly recommend placing all custom policies in site specific include files in the /etc/sudoers.d directory defined by the #includedir /etc/sudoers.d directive in the main sudoers file. In an unfortunate design choice the hash in #includedir does not denote a comment.

Best practice is to use the visudo command to make changes in the sudoers file instead of editing the file directly as that includes a number of provisions to edit the file in safe fashion and will check for a valid syntax reducing the risk for operators to lock themselves out. The editor defaults to vi but may be overridden by setting the EDITOR or VISUAL environment variable to an alternate editor.

In most sites it is recommended to only create policies for groups and not for individual users.

More information specific to your system is found in section five of the system manual (man 5 sudoers) and (man 8 visudo).

history | show excerpt | excerpt history