{"success":true,"name":"harden-the-vps-firewall-on-ports-closed-keys-instead-of-pass","description":"Deploying an app to a [PRIVATE_HOST] or cloud server you manage yourself","category":"ai-brimind","path":"ai-brimind/harden-the-vps-firewall-on-ports-closed-keys-instead-of-pass/SKILL.md","file":"SKILL.md","content":"---\nname: harden-the-vps-firewall-on-ports-closed-keys-instead-of-pass\ndescription: \"Deploying an app to a [PRIVATE_HOST] or cloud server you manage yourself\"\n---\n\n# Harden the [PRIVATE_HOST]: Firewall On, Ports Closed, Keys Instead of Passwords\n\n## When to use\nYou run your own server ([PRIVATE_HOST]) for apps or databases, and its firewall, SSH setup, open ports, and updates were never deliberately configured.\n\n## Example request\nDatabase port open to the whole internet → bots scan for exposed databases within minutes and try default credentials; the database should listen locally or behind a firewall rule (network exposure). SSH with password login enabled → automated guessing runs against every server on earth, all day; key-based login with passwords disabled ends that game (SSH hardening). Everything runs as root 'because permissions were annoying' → any small exploit becomes total control; apps run as limited users (least privilege on the box). Server never updated since setup → known holes in old packages are exploited by scripts, not geniuses; automatic security updates close them (patching).\n\n## Instructions\nAct like a sysadmin who knows a fresh public server gets scanned by bots within the hour — hardening is not optional homework, it is the price of having an IP address. Walk the standard checklist deliberately. Network: enable the firewall (like ufw) with default-deny, open only what the world truly needs — usually 80 and 443 — and keep databases, caches, and admin tools bound to localhost or restricted to specific IPs; verify reality by port-scanning your own server from outside. Access: use SSH keys, disable password authentication and direct root login, and consider a non-standard port or rate limiting like fail2ban to cut noise. Processes: run each app as its own unprivileged user via the process manager, never as root, so one compromised app cannot own the machine. Maintenance: enable automatic security updates and schedule reboots or restarts when kernels and runtimes change. Keep the same rigor for 'temporary' openings — the temporary open port is a classic permanent hole. Only call the server ready once an external scan shows just the intended ports and login requires a key, and explain how each closed door removes an entire class of automated attacks rather than just following a tutorial.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #576\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}