agentleFS
fablier-devfablier-dev/claude-ops-skills/skills/server-doctor/SKILL.md

server-doctor

Skill0 starsChanged 3 months agoMITView on GitHub

Diagnose an unfamiliar or misbehaving Linux server — what it is, what runs, what listens, who gets in, what's about to break — and produce a structured findings report with risk levels. Use when asked to audit, inspect, health-check, or "figure out" a server.

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. qwwiwi/agentos-skills-public★ 4same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

The file

Files
SKILL.md

Server Doctor (read-only diagnosis)

Build an accurate picture of a server before anyone changes anything. Everything in this skill is read-only — that is a feature: it can be run on production, first day, zero trust, no risk.

Work through the five questions in order; each section feeds the report at the end.

Q1 — What is this machine?

grep PRETTY /etc/os-release; uname -r
hostnamectl
uptime                          # load AND how long since last reboot
timedatectl                     # wrong clock breaks TLS, logs, cron
df -h --output=target,pcent,avail | grep -v tmpfs
free -h

Flag: disk >80% (investigate growth with du -xhd1 / | sort -h), swap heavily used with free RAM low, uptime spanning known kernel CVEs.

Q2 — What is running and exposed?

ss -tulnp                       # every listener, with owning process
systemctl list-units --type=service --state=running
systemctl list-units --failed   # ← the fastest source of "why is X broken"
systemctl list-timers           # scheduled jobs (the modern crontab)
crontab -l; ls /etc/cron.d/ /var/spool/cron/crontabs/ 2>/dev/null

For each listener, classify: loopback-only (127.0.0.1:) = fine; 0.0.0.0:/[::]: = internet-facing unless a firewall says otherwise — which is the next question.

Q3 — What protects it?

ufw status verbose 2>/dev/null || iptables -L -n | head -40   # or nft list ruleset
fail2ban-client status 2>/dev/null && fail2ban-client status sshd
sshd -T | grep -Ei 'permitrootlogin|passwordauthentication|port '
systemctl is-enabled unattended-upgrades 2>/dev/null
apt list --upgradable 2>/dev/null | wc -l

The dangerous combination to call out explicitly: password auth on + root login allowed + no fail2ban — that server is being bruteforced right now (Q4 will show it).

Q4 — Who gets in, and who tries?

who; last -20
awk -F: '$3 == 0 {print $1}' /etc/passwd          # UID-0 accounts besides root
awk -F: '($2 != "*" && $2 != "!") {print $1}' /etc/shadow   # accounts WITH a usable password
# run as root — $(wc -l < file) redirects as the *calling* user, sudo won't help mid-pipe
while IFS=: read -r u _ _ _ _ h _; do
  f="$h/.ssh/authorized_keys"
  [ -s "$f" ] && echo "$u: $(wc -l < "$f") key(s)"
done < /etc/passwd
grep -c 'Failed password' <(journalctl -u ssh --since -24h) 2>/dev/null
journalctl -u ssh --since -7d | grep -i 'accepted' | awk '{print $NF, $0}' | tail -10

Unknown keys in authorized_keys are a bigger finding than any config issue — every key is a door, and nobody rotates doors they forgot exist.

Q5 — What is about to break?

certbot certificates 2>/dev/null | grep -E 'Name|Expiry'   # or: check cert dates on :443
journalctl -p err --since -48h --no-pager | tail -30
dmesg -T --level=err,warn 2>/dev/null | tail -15            # OOM kills, disk errors
systemctl list-timers | grep -i certbot                     # renewal actually armed?

The report (always produce it, in this shape)

# Server report — <host>, <date>
## Identity     — OS, kernel, uptime, disk/RAM headroom
## Services     — running (with listeners), failed, scheduled
## Exposure     — internet-facing ports vs firewall reality
## Access       — who can log in, by what method; auth attack volume
## Risks        — ordered list, each tagged [critical]/[warn]/[info],
##                each with the single command or change that fixes it
## Deliberately not changed — this skill is read-only; say so

A risk entry must name its consequence, not just the fact: "[critical] password auth + 9k failed logins/24h → account takeover is a matter of time → migrate to keys (see ssh-key-migration)" beats "password authentication is enabled".

Failure modes this skill prevents

  • "Fixing" a server nobody understood first — the fix targets the wrong layer (nginx blamed, firewall guilty).
  • Auditing config files while systemctl list-units --failed was the two-second answer.
  • Declaring a server safe on firewall evidence alone, with a forgotten world-readable service on 0.0.0.0 or a stray UID-0 account.
  • Missing the expired-cert-in-3-days because "everything works today".
  • Reports that list facts without consequences — the operator can't rank what to fix first.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.