Skip to content

sudo and the user-space toolbox

angel has full sudo with a password; agent shells have no tty, so sudo fails in tool calls. Everything root-level is either pre-authorised by a scoped grant, done by the user with ! sudo …, or done by a tool that "handles sudo itself" (it prompts in the user's terminal).

Shape

No grant is live/etc/sudoers.d/90-claude-maintenance (NOPASSWD snapraid + systemctl, installed 09-03 for the hardening items) was removed by the user on 2026-09-08. sudo -n now fails for everything; root work goes through a fresh scoped grant or a root-run installer/timer. Pattern for a new one is in processes/root-maintenance.

Operator tools in ~/.local/bin (all say "handles sudo itself — no prefix"):

Tool Does
rk rescue kit: status · run · test · log -f · set K V · update · setup
sr run the SnapRAID sync unit and report (the safe way to sync)
gf fix gluetun's permanently-red healthcheck, with leak rollback
mf fix swap thrashing (swappiness)
sf turn off SSH password auth safely
fbpass reset the Filebrowser password (stops/starts the container)
newkey <device> make + authorise an SSH key, serve it via Filebrowser once
training-sync <mode> the Garmin→Calendar scheduler wrapper
vpn-check VPN egress check for homer
history-backup <mode> restic history job: backup · weekly · drill · check · status
restic 0.19.1 static binary (source ~/.config/restic/env first)
notes-sync commit + push the ~/Notes vault
claude~/.local/share/claude/versions/2.1.263 · codex · gh uv uvx rg fd bat fzf delta cloudflared tunnel-client binaries, no apt

Shell (~/.bashrc managed block): cat is aliased to bat — use catp (or command cat) for plain output; dps = docker ps table; ports = ss -tulpn; git aliases gs gd gl gco gp gpl. Node via nvm (24 LTS), never set NPM_CONFIG_PREFIX.

Home-dir one-off scripts (not scheduled): fix-snapraid-sync.sh (item 06 exclusion), fix-arr-remove-completed.sh (09-03 incident remediation), cron-report.sh, torrentvpn-backup.sh (older backup; superseded by docker-backup.sh), finish-private-apps.sh, claude-start.sh, claude-kill.sh. Leftovers: docker-backup.sh.new, daemon.json.new, snapraid-sync-*.log (Feb), fsck-* (Feb).

Why this shape

The user wants agents to do the work with a human holding the root key. Scoped grants make the blast radius explicit and revocable; the "handles sudo itself" tools keep day-to-day operations one word long.

If you change this

  • Hits: any new grant must pass visudo -cf and be 0440 · the auto-mode classifier blocks root writes from subagents and firmware writes (idle3ctl -d) even from the main session — plan those as user-run lines.
  • Does not hit: container operations (angel is in the docker group; no sudo needed).

See

  • Source: sudo -n -l · ls -l /etc/sudoers.d/ · ~/.local/bin/* headers · memory dev-env-user-space-installs.md