$linuxjunkies
>

sudoers

also: /etc/sudoers, sudo configuration

The sudoers file is a configuration file that controls which users can run commands with elevated privileges using the sudo command, and what commands they're allowed to execute.

The sudoers file, typically located at /etc/sudoers, defines security policies for privilege escalation on a Linux system. It specifies which users or groups can run which commands with sudo, and whether they need to enter a password.

The file uses a specific syntax to grant permissions. For example, alice ALL=(ALL) ALL allows user alice to run any command as any user. More restrictive rules like bob ALL=(root) /usr/bin/systemctl limit bob to running only the systemctl command as root.

The sudoers file should always be edited using the visudo command, which validates the syntax before saving. Editing it directly with a text editor risks creating syntax errors that can lock all users out of sudo access.

Related terms