Emergency server help: get in touch

Server hacked: incident response runbook for Linux and cPanel Pro

An incident response runbook for a hacked Linux or cPanel server: contain it, preserve evidence, find the entry point, decide clean or rebuild, rotate credentials in the right order and tell customers.

Published Updated 10 min read
ProThis is part of srvScripts Pro. See what Pro includes.

The first hour after you discover a compromise decides whether you will know what happened, or only that you cleaned something. Most damage in hosting incidents is done by the responder: a reboot that wipes the running malware, a cleanup scanner that deletes the web shell before anyone reads the access log, a password reset done while the attacker still has a shell and watches it happen. This incident response runbook gives the order we work in: contain, preserve, investigate, decide, rotate, communicate, harden.

Short answer: Do not reboot, delete anything or run an automatic cleanup first. Contain the damage (suspend the one affected account, or isolate the server if root may be compromised), capture running processes, connections and deleted binaries to another machine, and copy the logs off before the attacker cleans them. Then find the entry point, rebuild on a fresh server if the attacker may have had root or you cannot find how they got in, rotate credentials from the most powerful downwards only after the hole is closed, and tell affected customers early. (Reviewed October 2026.)

srvScripts Pro

The rest of this is for Pro members.

Pro removes ads and adds Pro scripts, runbooks, 50 monitors, the Tools API and a bigger AI quota — and it keeps the free tools free.

See Pro plansSign in

Free website test

Is your website set up right?

Check SSL, security headers, redirects, robots.txt, sitemap, llms.txt and security.txt in one test. It takes about 30 seconds.