Skip to main content

What to Do After a Linux Server Is Compromised

November 17, 2026 5 min read
A row of server cabinets in a softly lit, orderly server room.

If you are deciding what to do after a Linux server is compromised, focus on three priorities: limit further harm, preserve useful evidence, and keep business decisions coordinated. Avoid treating a server that appears contained as a server that is understood or safe to restore.

This first-hour guide is a practical sequence, not a substitute for your incident response plan. Assign a technical lead and a business decision-maker, and involve an incident-response provider if one is available. The CISA incident response playbooks and NIST incident response guidance can help teams structure investigation, response, and recovery.

Minutes 0–10: Confirm the concern and start coordination

Start a single incident record using a channel that is not hosted on the potentially affected server. Record when the concern was reported, what was observed, who is coordinating, and what actions are taken. Keep updates factual and time-stamped.

  • Technical lead: Coordinate investigation and containment. Avoid asking several people to make untracked changes on the host.
  • Business decision-maker: Identify which services rely on the server and what disruption is acceptable while teams respond.
  • Communications lead: Coordinate internal updates and direct questions to an agreed contact. Avoid speculation about what happened or what data may be affected.
  • Incident-response provider: Bring in qualified responders when available, especially if the incident may affect other systems or sensitive information.

Use a clean device and trusted connection for coordination. Do not use the suspected server to change passwords, review sensitive accounts, or send incident updates.

An unmarked storage device and network cable beside a closed notebook on a desk.

Minutes 10–20: Contain access without destroying options

Decide how to isolate the server based on the signs of active harm and the cost of taking its service offline. If possible, restrict network access through a firewall, cloud security control, or network segment while preserving a controlled management path for responders. Removing a server from a load balancer may reduce user impact if a safe alternative is available.

Do not automatically power off or reboot the host. A shutdown can remove volatile evidence, and changes made in haste can complicate later investigation. If there is active data theft or ongoing damage, stopping that activity may take priority. Have the technical lead and incident responders weigh the risks, and record the reason for the decision.

Ask the continuity question alongside every technical action: which business function is affected, what depends on this server, and is there a safe workaround? Tell internal stakeholders what is unavailable and what they should use instead. Do not reconnect the host simply to restore service before its risk is understood.

Minutes 20–35: Preserve evidence and check access paths

Preserve what is available before cleanup, reinstallation, or routine maintenance changes the system. If responders are involved, follow their collection instructions. Capture relevant records to a secure location, including authentication and privilege-use logs, system and application logs, monitoring alerts, and available cloud control-plane activity.

For a Linux environment, relevant sources may include SSH authentication records, account and service-account activity, authorized SSH keys, scheduled tasks, service configuration, and changes made through cloud consoles or automation. Check centralized logging and identity systems too. A server’s local records may be incomplete or altered, so do not use them alone to decide the extent of access.

Keep original evidence protected and limit access to people who need it. Record who collected each item and when, along with relevant commands or configuration changes. Avoid deleting suspicious files, reinstalling packages, rotating every credential at once, or running cleanup scripts before responders have considered evidence needs.

Minutes 35–45: Scope the incident and reduce exposed access

Work out what may be affected without assuming the incident is limited to one host. Review connected systems, identity providers, network activity, cloud accounts, deployment tools, and shared storage for related signs. Consider whether the suspected entry point could also have exposed credentials or service accounts that grant access elsewhere.

From a clean, trusted device, prioritize access that could extend the incident. Depending on what the investigation shows, this may include revoking active sessions, disabling compromised accounts, or replacing exposed SSH keys and cloud credentials. Coordinate the order with the technical lead so that responders retain necessary access and dependent services are not disrupted unexpectedly.

Do not assume that a password change alone removes an attacker’s access. Responders should assess whether other access methods or persistence mechanisms remain, and whether the initial weakness has been addressed.

Minutes 45–60: Assess recovery options, but do not rush restoration

Identify backup copies and recovery dependencies, then establish whether a copy is isolated from the incident, likely predates the compromise, and can be validated before use. The fact that a backup exists does not establish that it is trustworthy. For a practical approach to restore testing, see how to test Linux backups and prove you can restore.

Plan recovery in a clean environment rather than assuming the affected host can be made safe by removing visible symptoms. Before bringing services back, the response team should assess the incident’s scope, investigate whether access or persistence remains, address the entry path, and validate the system and data to be restored. The business decision-maker should confirm service priorities and accept the operational trade-offs.

For healthcare providers, involve the appropriate security, privacy, and business leaders if the server may contain patient information. Determine what systems and data may be involved before making claims about exposure. Recovery priorities and dependencies can be planned in advance; see healthcare Linux recovery planning.

Frequently asked questions

Should I disconnect a compromised Linux server or shut it down?

Isolation can limit further access, but the safest method depends on the activity, service impact, and evidence needs. Consider restricting network access before powering off, and coordinate the decision with incident responders when possible.

How can I tell whether an attacker still has access?

There is no single sign that settles the question. Review host records alongside identity, network, cloud, and centralized monitoring data, and have responders assess for additional access paths and persistence.

Should I change passwords and revoke keys during the first hour?

Prioritize suspected exposed credentials from a clean device, and coordinate the order with the technical lead. A broad, unplanned rotation can disrupt services or complicate response, and it does not by itself prove that access has been removed.

When is it safe to bring the server back online?

Only after the response team has assessed the scope, addressed the entry path, investigated ongoing access, and validated the recovery environment and data. The business owner should approve the service-restoration plan.

Make the next step deliberate

In the first hour, contain carefully, preserve evidence, coordinate business continuity, and treat restoration as a decision with clear checks. If your team needs operational help with Linux infrastructure, contact Zevonix at (904) 658-0777 to discuss the situation and next steps.

Ready to Strengthen Your IT?

Let Zevonix handle your technology so you can focus on what matters most — your business.

Schedule a Free IT Assessment