sudoers file
The configuration file, /etc/sudoers plus files in /etc/sudoers.d, that says who may run which commands as which user through sudo.
An overly broad or writable rule gives its users unrestricted root.
In more detail
A rule can let one user run exactly one command as root, such as restarting one service. Edit it only with visudo, which checks the syntax so a mistake cannot lock everyone out. A rule that allows every command as every user is effectively full root access.
Example
Adding a line to /etc/sudoers or a file in /etc/sudoers.d is a classic way to keep administrator access, so audit rules watch both for writes.Related terms
- sudo — A command that runs another command with administrator (root) rights after checking you are allowed to.
- least privilege — Giving every program and person only the access they need, and nothing more.
- root user — The all-powerful administrator account on Linux, with user ID 0, which can read or change anything.
- authorization — Deciding whether an already identified caller may perform a particular action on a particular resource.
- audit rule — A line that tells the Linux audit system what to record, such as every execve call by a logged-in user or every write to /etc/shadow.
- privilege escalation — Gaining the rights of a more powerful account, such as root, either deliberately through a tool like sudo or illegitimately through a flaw.
Taught in
- Setuid, Setgid, And Root Through sudo — Linux Fundamentals & Systems Administration
- Logins, su, sudo And SSH Between Hosts — Red Hat Certified System Administrator (EX200) Exam Prep
- Privileged Access: sudo Rules In Drop-In Files — Red Hat Certified System Administrator (EX200) Exam Prep
- Drill: Storage, Then SELinux, Then The Firewall — Red Hat Certified System Administrator (EX200) Exam Prep
- Drill: People, Packages And Time — Red Hat Certified System Administrator (EX200) Exam Prep
- Mock Exam, Part 1: Eighteen Tasks, One Reboot — Red Hat Certified System Administrator (EX200) Exam Prep
- Windows Event Logs, Sysmon & Linux Auditd Telemetry — Security Operations & Threat Hunting (SOC)
- Who Wrote That Sudoers File? The Journal, rsyslog, logrotate And auditd — CompTIA Linux+ (XK0-006) Exam Prep
- The Pager Command That Opened A Root Shell: sudo, su And Least Privilege — CompTIA Linux+ (XK0-006) Exam Prep
- Three PBQs Against The Clock: A Performance-Based Mock On Both Families — CompTIA Linux+ (XK0-006) Exam Prep
- Exam Strategy: The First Fifteen Minutes And ansible-doc — RHCE in Ansible (EX294): Automate Red Hat Systems
- ansible.cfg: Which File Wins, And The Settings That Matter — RHCE in Ansible (EX294): Automate Red Hat Systems
- SSH Keys And An Account For Ansible — RHCE in Ansible (EX294): Automate Red Hat Systems
- Privilege Escalation: sudo Rules And become — RHCE in Ansible (EX294): Automate Red Hat Systems
- Deploying Files: file, copy, lineinfile And blockinfile — RHCE in Ansible (EX294): Automate Red Hat Systems
- Drill: Storage Only Where The Disk Exists — RHCE in Ansible (EX294): Automate Red Hat Systems
- Drill: People, Passwords And sudo From The Vault — RHCE in Ansible (EX294): Automate Red Hat Systems
- Mock Exam, Part 2: Real Machines And The Patterns That Fail — RHCE in Ansible (EX294): Automate Red Hat Systems