harden-vps

Harden Ubuntu and Debian VPS servers through phased SSH, firewall, Docker, and monitoring configuration.

15|3|Updated Jul 9, 2026
One-click install
npx skills add https://github.com/kiurakku/cursor-kit-for-ai --skill harden-vps-kiurakku
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: harden-vps
Source: https://github.com/kiurakku/cursor-kit-for-ai/tree/main/plugins/security/skills/harden-vps
Command: npx skills add https://github.com/kiurakku/cursor-kit-for-ai --skill harden-vps-kiurakku

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? New VPS servers ship with insecure defaults — password authentication, open ports, and Docker containers that bypass the firewall — leaving production workloads exposed to scanners and attackers. ## Core Features & Use Cases - Phased Hardening Workflow: Five ordered phases covering SSH access, UFW firewall rules, attack surface reduction, application-layer controls, and detection/recovery setup. - Docker Exposure Detection: Identifies the common trap where published container ports bypass UFW, with verification commands using nmap and ss. - Audit Mode: Runs the same phases as checks against an existing server, producing a severity-ranked hardening report with findings, evidence, and fix commands. - Use Case: After provisioning a fresh Ubuntu VPS for a Dockerized app, follow the phases to disable password login, lock down ports to 22/80/443, bind databases to loopback, and set up fail2ban and unattended upgrades. ## Quick Start Harden this new Ubuntu VPS running Docker by walking through the SSH, firewall, and monitoring phases and verifying each step.

Frequently Asked Questions about harden-vps

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I secure a new Ubuntu VPS for production?▼

Secure a new Ubuntu VPS in dependency order: create a sudo user with SSH keys and disable password and root login, enable UFW with default-deny incoming rules allowing only ports 22, 80, and 443, then add fail2ban, unattended-upgrades, and offsite backups. Always test a new SSH session before closing the current one.

Why does Docker bypass my UFW firewall rules?▼

Docker writes its own iptables rules, so publishing a port with docker run -p 5432:5432 exposes it publicly regardless of UFW configuration. Bind internal services to loopback with 127.0.0.1:5432:5432 or omit ports entirely and rely on the compose network, then verify externally with nmap.

How do I audit an existing Linux server for security issues?▼

Audit a running server by checking public listeners with ss -tlnp, reviewing sshd_config for PasswordAuthentication and PermitRootLogin, inspecting UFW status and Docker iptables rules, and examining last, lastb, and auth.log for suspicious logins. Each public port and running service should be individually justified.

What should I do after a suspected server compromise?▼

After a suspected compromise, do not attempt to clean the server in place. Snapshot it for forensics, rotate every credential the machine held, rebuild from scratch, and restore data from tested backups, since cleaning against a competent attacker is unreliable.

Does changing the SSH port improve server security?▼

Changing the SSH port only reduces log noise from scanners; it is not a real security control. Key-only authentication with ed25519 keys provides the actual protection, and placing SSH behind WireGuard or Tailscale offers stronger admin-only reachability.