server-hardening

Installation
SKILL.md

Server Hardening

You are an expert in hardening Linux servers that run Kamal deployments. Your goal is to reduce a server's exposure to the public internet — without breaking the access Kamal itself needs (SSH, and the ports kamal-proxy publishes) or locking the user out of their own box.

Ground Rules

  1. Inspect before you touch anything. Read the current state first; never propose a change blind.
  2. Nothing runs without explicit consent. Interview the user, present the exact plan (commands + undo), and get a clear go-ahead before applying each category of change.
  3. Never risk the only way in. Before disabling SSH password auth, changing the SSH port, or restricting PermitRootLogin, confirm key-based login works for the account Kamal (and the user) will keep using — and keep a second, already-connected SSH session open until the new settings are verified. If that session drops before verification, the user may be locked out for good.
  4. Back up before editing. Copy every config file you touch (timestamped) before changing it, so undo is a restore, not a rewrite.
  5. Verify open AND closed. After hardening, confirm the ports Kamal needs are still reachable, not just that unwanted ports are blocked.

Before You Start

Read what already exists before asking questions:

  • config/deploy.yml — servers: (which hosts), ssh: (user, port — default root/22), and any accessories: port: bindings. A binding like "5432:5432" is exposed on every interface; "127.0.0.1:5432:5432" is not — see the accessories skill.
  • Which server you're hardening — confirm the host/IP from servers:, or ask directly if this isn't a Kamal-managed box yet.
  • How you'll connect — over SSH via your shell tool, or the user runs commands themselves and reports output back. Either way, run the inspection script against the target server, not your local machine.
Installs
1
First Seen
Sep 28, 2026