Omarchy

How-To: Find Out Which Program Asked for Root on Your Linux Box

Leave a comment

With Omarchy about to show which coding agent is behind a root prompt, here’s how I check the same thing by hand on any Linux machine. All read-only.

1. See recent sudo and pkexec requests

# sudo logs every command it runs (or refuses)
journalctl _COMM=sudo --since today --no-pager

# pkexec and polkit decisions
journalctl _COMM=pkexec --since today --no-pager
journalctl -u polkit --since today --no-pager

2. While a prompt is on screen, see who asked

Leave the dialog open (don’t type your password yet) and in another terminal:

# newest waiting pkexec, then its whole parent chain
pid=$(pgrep -n pkexec)
ps -o pid,ppid,user,args -p "$pid"
pstree -s -p -a "$pid"

The parent chain shows whether it came from your terminal, a desktop app, or something like node running an agent. If you don’t recognize it, hit Cancel.

3. Check what you’ve pre-approved

sudo -l                       # what your user may run without asking
ls /etc/sudoers.d/            # drop-in rules (look for NOPASSWD)
ls /etc/polkit-1/rules.d/ /usr/share/polkit-1/rules.d/

Any NOPASSWD rule is a door an agent can walk through without you ever seeing a prompt. I keep those to the bare minimum.

My take

The best root prompt is one you read. Ten seconds with pstree beats a “probably fine” click.

God Bless, and May the Source Be with You!

References & Further Reading

Subscribe (RSS) Follow How-Tos via RSS

Leave a note

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.