What to do if your server is compromised
Updated 27 Nov 2026 security incident
Contain the problem, preserve evidence and rebuild from a clean system.
Signs
Unknown processes using CPU, unexpected outbound traffic, new users or keys, changed files, abuse notices.
1. Contain
Shut the server down from the dashboard, or restrict it with its firewall if you must investigate. Open a Security ticket.
2. Preserve what you can
Do not wipe immediately if you need to know what happened. Note times and copy logs off the server:
last -a | head -30
sudo ss -tunap
sudo journalctl --since "7 days ago" > journal.txt
sudo find / -xdev -mtime -3 -type f 2>/dev/null | head -200
A compromised system can hide things from these tools.
3. Rebuild
Reinstall and restore data from a backup made before the intrusion. Do not copy programs back from the old system.
4. Change every secret
SSH keys, database and application passwords, API tokens, and your VPSNest password.
5. Close the door
Find how they got in: an outdated application, weak password or exposed service.
Legal duties
You may have to notify users or authorities within short deadlines. Get advice early.