Safely edit sudoers
high risk
visudo -cValidate after editingvisudo -f /etc/sudoers.d/<name>Use drop-in filesLocks and syntax-checks /etc/sudoers before saving.
| Flag | Meaning |
|---|---|
-c | Check syntax only |
-f | Edit a specific file (e.g. /etc/sudoers.d/x) |
visudo -cValidate sudoers · explain & risk-check →visudo -f /etc/sudoers.d/deployEdit a drop-in · explain & risk-check →Reference text is hand-written and may be incomplete — check man visudo for your version. Test destructive commands on a non-production system first.