Cehpoint

How to tell if your server has been hacked

How to tell if your server has been hacked: the warning signs on a Linux web server, what to check first, and the steps to take in the first hour.

A technician working on network equipment in an open server rack

Most small businesses find out their web server has been hacked by accident: the site slows down or the host sends a warning. This guide covers the signs to look for on a Linux server (the computer, usually rented, that hosts your website), what to check first, and what to do in the first hour. You do not need to be technical to follow the decisions, and the technical checks are explained along the way.

How can I tell if my web server has been hacked?

The clearest signs are activity you cannot explain: the processor running at full load with no extra visitors, sign-ins from unfamiliar places, new user accounts or SSH keys, unknown scheduled tasks, programs running from temporary folders, and new network ports open. One odd sign can be innocent. Several together usually mean someone else is using the server.

Warning signs a business owner might notice without logging in:

  • The website is slow or keeps going down, even though traffic is normal.
  • Your hosting provider emails to say your server is sending spam, attacking other machines or using unusual bandwidth.
  • Search results show your site with pages you never wrote, often selling medicines, gambling or counterfeit goods.
  • Visitors are redirected to another site, or their browser warns them your site is unsafe.

Signs your developer or IT support would see on the server itself:

  • High processor use from an unknown program. Hijacked servers are often used for cryptocurrency mining (using your computing power to earn money for the attacker), which keeps the processor busy around the clock.
  • Sign-ins you do not recognise. SSH (Secure Shell, the remote login used to manage Linux servers) records every sign-in, with the account and the address it came from.
  • New SSH keys. A key added to an authorized_keys file lets someone sign in without a password, even after you change every password.
  • New scheduled tasks. Attackers add entries to cron (the Linux task scheduler) so their program restarts after you remove it.
  • Programs running from /tmp or /dev/shm. These temporary folders can be written by almost anything, so malware often starts there.
  • Login records that have shrunk or gaps in the logs. Attackers sometimes delete the evidence of their sign-in.

What do attackers usually do with a hacked Linux server?

On a typical small-business web server, attackers mostly want free computing power and a trusted internet address. Common uses are cryptocurrency mining, reselling your connection as a proxy, sending spam, hosting phishing pages, attacking other servers and stealing whatever data the website holds, such as customer records or passwords stored in configuration files.

The reason matters later. If the attacker could read your database or configuration files (for example a .env file holding passwords and keys), assume that data and every password in it is in their hands. That decides what you must change, and whether you have a personal data breach to report.

Which files and logs should I check first?

Start with sign-ins, running programs, scheduled tasks and network connections, because these show both whether someone got in and whether they are still there. Ask whoever manages the server to collect the output before changing anything, so you keep a record of what you found.

The checklist below is a starting point for your developer or IT support. Commands differ slightly between Linux versions.

What to check Where or how (common Linux commands) What would worry you
Recent sign-ins last, journalctl -u ssh (or sshd) Sign-ins from countries or addresses you do not use
Failed sign-ins lastb, the SSH journal Thousands of attempts, then one success
User accounts /etc/passwd Accounts nobody created
SSH keys ~/.ssh/authorized_keys for each user, including root Keys nobody on the team recognises
Running programs top, ps aux Unknown names using lots of processor, anything running from /tmp
Scheduled tasks crontab -l for each user, /etc/cron.*, systemd timers Tasks that download or start files
Open ports ss -tulpn Listening programs you did not install
Library hijacking /etc/ld.so.preload Any entry at all, unless you know why it is there
Website files Recently changed files in the web folder New PHP files, edited index pages
Web access logs nginx or Apache access logs Requests for .env, .git or wp-login.php, or for unfamiliar pages

Keep a written note of what you check and when. The NCSC's guidance on technical incident response capabilities recommends documenting which logs you have, keeping logs for at least three months where possible, and synchronising every log source to the same time so events can be lined up.

What should I do in the first hour if my server has been hacked?

Do not panic-delete files. In the first hour, record what you see, cut off the attacker's access, protect the data that matters, and decide who needs to be told. Changing passwords from the hacked server itself, or wiping it before anyone looks, can make the problem harder to understand.

A practical order:

  1. Write down the time and what you noticed.
  2. Take a snapshot or backup of the server as it is, if your hosting provider offers snapshots. This preserves evidence.
  3. Limit access. Block the addresses you saw signing in, remove unknown SSH keys and accounts, and if the attack is active, ask your host to take the server off the internet.
  4. Change passwords and keys from a clean computer, not from the server. Include the hosting control panel, database passwords, email accounts, payment provider keys and any API keys in configuration files.
  5. Check your backups and work out the last date you are confident the server was clean.
  6. Decide whether personal data was exposed. If customer or staff data could have been read, the UK GDPR reporting clock may already be running (see below).

The NCSC's incident management guidance also warns that overreacting can cause more damage than the incident itself, and that in some cases it is better to monitor and analyse further before acting. For a small business the balance is usually simple: stop active damage quickly, but keep the evidence.

Should I wipe and rebuild a hacked server?

Usually, yes. Once an attacker has had administrator access, you cannot be sure you have found everything they changed. The safer route is to build a fresh server, restore website files and data from a backup made before the compromise, apply all updates, and only then point your domain at it.

Before you rebuild:

  • Keep the snapshot of the old server so you can answer questions later (what was accessed, and when).
  • Find the way in. If the attacker used a weak password, an old plugin or an outdated package, restoring the same setup will let them straight back in.
  • Check the restored website files, not just the server. Attackers often hide code in website folders, which a backup will faithfully copy back.

If you cannot rebuild straight away, remove what you found, close the way in, change every credential and watch the server closely.

Do I have to report a hacked server?

There is no general duty to report a hacked server, but two routes apply to most UK businesses. You can report a cyber incident through the government's report a cyber incident service, and if personal data was involved you may have to tell the ICO within 72 hours.

The GOV.UK service is provided by the NCSC and signposts you to the right place to report. It states that information you give there is not shared with the ICO, and that you may need to report separately to the ICO if personal data has been breached.

On the ICO side, its guide to personal data breaches says a notifiable breach must be reported without undue delay and no later than 72 hours after becoming aware of it, and that you must record all breaches whether or not you report them. The ICO's breach self-assessment helps you decide whether yours needs reporting.

How can I stop my web server being hacked again?

Most small-business server compromises start with something preventable: password sign-in left on for SSH, an outdated plugin or package, or a secret file left readable on the website. Fixing those, keeping updates current and watching the server continuously closes most of the doors.

The basics:

  • Use SSH keys instead of passwords, and turn off direct root sign-in.
  • Install security updates promptly, and remove software you no longer use.
  • Block addresses that repeatedly guess passwords (a tool such as fail2ban does this).
  • Make sure files such as .env, .git folders and database dumps cannot be downloaded from your website.
  • Keep backups off the server, and test that you can restore them.
  • Watch the server all the time, not only when something feels wrong. The NCSC's logging and monitoring guidance describes monitoring as actively analysing logs for signs of known attacks or unusual behaviour.

This last point is where Cehpoint's web server security monitoring fits. A lightweight agent on each Linux server checks sign-ins, running programs, scheduled tasks, SSH keys, open ports and website attacks in the access logs, and explains each alert in plain English. In Guard mode it automatically blocks password-guessing and website-attack addresses, installs security updates and renews certificates; it works from a fixed list of named actions rather than a remote shell. The Agentic SOC page explains the three automation levels.

The office computers that reach your server deserve the same attention: a stolen laptop password is another way in. Cehpoint's computer security checks look for signs of a break-in on Windows PCs and Macs as well as missing updates.

Frequently asked questions

Can a website be hacked without the server being hacked?

Yes. An attacker can change your website through a weak admin password or a vulnerable plugin without ever gaining control of the server underneath. The checks are different: look at recently changed website files and new admin users in your content management system. If the attacker uploaded a script that runs commands, treat it as a server compromise too.

Will antivirus software tell me my Linux server is hacked?

Not reliably. Many Linux web servers run no antivirus at all, and attackers commonly use legitimate tools or programs built to avoid detection. Watching behaviour, such as unexpected sign-ins, new scheduled tasks, programs in temporary folders and unexplained processor load, catches problems that a file scan alone can miss.

How long can a hack go unnoticed?

It can be weeks or months, especially when the attacker is careful to keep the server working normally. That is why continuous monitoring and keeping logs for several months matter: without them you may not be able to say when the attack started or what was accessed, which you need for any breach report.

If you would like your servers watched continuously, with plain-English alerts and safe automatic responses, you can start free and see current pricing on the pricing page.

Sources checked on 2 December 2026.

See what your own servers need today.