batched-ssh-enumeration
Skill0 starsChanged 5 days agoMITView on GitHub
Use when a loop or watchdog SSHes across many hosts to probe, enumerate, or act. Force non-interactive SSH with timeouts so one un-authable host cannot hang the loop, and check a heartbeat so a stuck-but-alive process is detected.
In this repository108 other files it gives its agents.
- adaptive-estimationSkill
- adaptive-loop-budgetingSkill
- adopt-and-deleteSkill
- adversarial-reviewSkill
- agent-drives-uiSkill
- agentic-coding-loopSkill
- agent-otel-trajectorySkill
- agents-as-iac-modulesSkill
- ascii-ui-mockupsSkill
- authoring-html-emailSkill
- authoring-skills-vs-mcpSkill
- c4-architectureSkill
- challenge-the-premiseSkill
- codegraph-bootstrapSkill
- codegraph-worktree-startupSkill
- colocated-pod-tolerationsSkill
- command-creatorSkill
- complexity-budgetsSkill
- connector-readinessSkill
- context-anchored-patchingSkill
- continuous-issue-resolutionSkill
- credential-proxySkill
- criticality-tiered-reportingSkill
- data-connector-buildingSkill
- declarative-firstSkill
- disk-pressure-forensicsSkill
- early-return-over-elseSkill
- email-triageSkill
- enums-codify-behaviorSkill
- ephemeral-workspace-lifecycleSkill
- event-sourcingSkill
- evidence-claim-boundariesSkill
- exhaustive-matchSkill
- feature-coverage-not-just-line-coverageSkill
- full-disk-forensicsSkill
- gate-before-pushSkill
- github-pr-shepherdingSkill
- graceful-shutdown-stateful-agentsSkill
- grounded-generationSkill
- iac-incident-responseSkill
- iac-not-ad-hocSkill
- instrumented-service-scaffoldSkill
- interface-over-conditionalsSkill
- knowledge-routingSkill
- lean-on-oss-standardsSkill
- live-money-disciplineSkill
- live-state-verificationSkill
- loop-governance-and-learningSkill
- low-level-executor-task-specSkill
- map-dispatch-over-conditionalsSkill
- merge-conflict-disciplineSkill
- mermaid-diagramsSkill
- oke-arc-runners-opentofuSkill
- orchestrate-agySkill
- orchestrate-claudeSkill
- orchestrate-codexSkill
- orchestrate-geminiSkill
- otel-emit-at-willSkill
- parameter-designSkill
- parse-dont-validateSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 14
If key auth fails for any host (key rotated, host re-imaged, account removed), OpenSSH falls back to an interactive password prompt.
- Distinctive: line 40
Treat a failed host as skip-and-continue with a logged warning, never as a reason to block.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Batched SSH Enumeration
A loop that SSHes to a list of hosts — a fleet probe, a deploy fan-out, a shepherd that visits N repos/nodes — has two failure modes that quietly wedge the whole run. Both are avoidable with a few flags and a heartbeat.
Failure 1: one host drops to a password prompt and blocks forever
If key auth fails for any host (key rotated, host re-imaged, account
removed), OpenSSH falls back to an interactive password prompt. In an
unattended loop there is no human to type, so that one ssh call blocks
indefinitely, and every host after it never gets visited. One bad host =
total stall.
Force non-interactive, bounded SSH on every call:
ssh -o BatchMode=yes \ # never prompt; fail fast if key auth can't work
-o ConnectTimeout=10 \ # cap the TCP/handshake wait
-o StrictHostKeyChecking=accept-new \
"$host" "$remote_cmd"BatchMode=yesturns any prompt (password, passphrase) into an immediate non-zero exit instead of a hang.ConnectTimeoutbounds connection setup.- Wrap the whole call in an overall
timeouttoo, because a connection that succeeds but then hangs mid-command is not covered byConnectTimeout:
timeout 60 ssh -o BatchMode=yes -o ConnectTimeout=10 "$host" "$remote_cmd" \
|| log "host $host unreachable/timed out — skipping"Treat a failed host as skip-and-continue with a logged warning, never as a reason to block. Isolate each host so one failure cannot take down the sweep.
Failure 2: the watchdog trusts liveness, not progress
A watchdog that only checks "is the process / tmux session / pod still up?" is fooled by a live-but-stuck worker: the process is running, so liveness is green, but it has been blocked on one hung SSH call for hours making zero progress. Liveness ≠ progress.
Watch a heartbeat, not just a pulse. The worker writes a monotonic
heartbeat — a timestamp file, a counter, a last_progress_at field — every
time it actually advances (per host visited, per item done). The watchdog reads
that heartbeat and declares the worker WEDGED when it is stale beyond a
threshold, then restarts/alerts:
age=$(( $(date +%s) - $(stat -c %Y "$HEARTBEAT_FILE") ))
if (( age > STALE_THRESHOLD )); then
alert "worker WEDGED — heartbeat stale ${age}s"; restart_worker
fiReal incident: a global PR shepherd ran wedged for ~37 hours. The process was alive (liveness checks passed) but stuck on a single un-authable host's interactive prompt; no heartbeat check existed to notice it had stopped making progress.
Checklist
- Every
sshusesBatchMode=yes+ConnectTimeout. - Every remote call is wrapped in an overall
timeout. - A failed host is skipped-and-logged, never blocking.
- The worker emits a heartbeat on real progress.
- The watchdog flags stale heartbeat as wedged, not just dead process.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

