SUDOERS CHECK · RUNS IN YOUR BROWSER

Who can become root through your sudoers file?

A sudoers rule that allows one editor, one pager or one find allows a root shell. ALL, !/usr/bin/su stops nobody. A NOPASSWD line above %sudo never takes effect, and a drop-in named deploy.conf is never read. visudo accepts all of these without a word. Paste /etc/sudoers and the files in /etc/sudoers.d below: this page lists each risky rule with its file, line and fix, and who can get root and how.

Nothing is uploaded. What you paste is read in this browser and never leaves your device, and the tool makes no network calls of its own. It reads the files, not a running system: it is not visudo -c and not a security audit.

1. Paste your sudoers files

Name each block like its path. A block named sudoers is read first, and its @includedir /etc/sudoers.d pulls in every block named sudoers.d/something in sorted order, skipping names with a dot, the way sudo does. On the server, sudo cat /etc/sudoers /etc/sudoers.d/* shows them.

Paste at least one sudoers file above and click Check.

What it checks

The parser reads the grammar the way sudo does: aliases, tag and runas inheritance, : Host = groups, escapes, digests, option specs, regular-expression arguments and include order. On 41 test cases its reading matches cvtsudoers, sudo's own parser (1.9.15p5). Which programs give a shell is our own list; GTFOBins catalogues the exact escapes, and this tool is not affiliated with it. Every type, with the sudo behaviour behind it: sudoers mistakes explained.

Prefer a CLI, or want this in your own CI?

Same engine, zero dependencies, Node 18 or later:

sudo node check.mjs /etc/             # /etc/sudoers and /etc/sudoers.d/*
node check.mjs ./sudoers.d/90-app      # one drop-in from your repo
node check.mjs /etc --format json      # machine-readable
node check.mjs . --fail-on-risk        # exit 2 on any high or medium finding

Get check.mjs and scan.mjs from the repo: nothing to install, no network calls, and it never runs sudo. Run visudo -cf as well, for syntax.

Common questions

Why does my NOPASSWD rule in sudoers not work?

sudo uses the last rule that matches, not the most specific one. If your NOPASSWD line sits above %sudo ALL=(ALL:ALL) ALL (or %wheel) and you are in that group, the group rule matches later and asks for a password. Put the NOPASSWD rule after the group rule, which a file in /etc/sudoers.d does, because the @includedir line comes at the end of /etc/sudoers.

Why is my file in /etc/sudoers.d ignored?

sudo skips every file in an @includedir directory whose name contains a dot or ends in a tilde, so /etc/sudoers.d/deploy.conf is never read and none of its rules apply. Rename it to deploy or 90-deploy and check it with visudo -cf.

Is ALL, !/bin/su a safe way to stop a user becoming root?

No. The sudoers manual says subtracting commands from ALL is generally not effective: the user can copy su to another name, or start a shell from an editor or script. List the commands the user needs instead.

Why is allowing vim, less or find through sudo dangerous?

Those programs can start a shell or write any file. vim runs :!sh and can save over /etc/sudoers, less and man run !sh, and find runs any command with -exec, all as root. Use sudoedit for editing, a group such as adm or systemd-journal for reading logs, and pinned arguments or a root-owned wrapper script for the rest.

Does a clean result mean my sudo setup is secure?

No. It reads only the patterns listed on this page. It does not know your group memberships, the contents or permissions of the programs a rule allows, your sudo version, or LDAP and SSSD rules. Have a qualified person review anything that protects valuable data.