Keep the system up to date, switch SSH to keys and disable root login. Set up a firewall with default deny and run only the services you need. Add monitoring, tested backups following the 3-2-1 rule and application updates. With unmanaged servers you are responsible for all of this yourself.
Key facts
- First step
- Enable automatic security updates
- SSH
- Key authentication, root login disabled
- Firewall
- Default deny, only required ports open
- Backups
- 3-2-1 rule, test restores regularly
- Network level
- Basic DDoS protection included on every IP, reachability during an attack only with paid extended protection
- Emergency access
- IPMI with dedicated servers
Which basic measures come first?
Most compromised servers are attacked through outdated packages, weak passwords or services that are needlessly exposed, rarely through sophisticated methods. Work through the following points right after provisioning, before production data reaches the system. Any change made later is more work. Note what you have changed, as it helps with troubleshooting:
- Keep the system up to date and enable automatic security updates, for example via unattended-upgrades.
- Switch SSH to key authentication and disable password login.
- Turn off direct root login and work through a separate user with sudo.
- Set up Fail2ban so that repeated failed attempts are blocked automatically.
- Configure a firewall with default deny and open only the ports you need.
- Remove services you do not need and bind databases to localhost only.
A non-standard SSH port reduces automated scans in the logs but replaces none of the other measures. Every publicly reachable service also needs a valid TLS certificate.
Monitoring and log analysis
You need monitoring of availability and utilisation, and you should check the log files regularly. Warning signs are clusters of failed logins, unexpected outgoing connections, suddenly growing process lists or load at unusual times. Zabbix, Checkmk, Netdata or a simple uptime check are enough to start with. What matters is that you are notified when thresholds are exceeded rather than having to check dashboards yourself. Also send logs to a second system, because anyone who takes over a server deletes the local logs first. A file integrity check adds to this.
What does a robust backup strategy look like?
Backups still help after an attack has succeeded. The 3-2-1 rule has proven itself: three copies of the data on two different media, one of them off the system. The backup target must not be reachable with the same credentials as the server, otherwise ransomware encrypts both. Test your backups as well. Regularly restore one onto a separate system and time it. That tells you how much downtime to expect in an emergency. Also check whether databases are backed up consistently.
What needs to be done at application level?
A hardened operating system is of little use if the application on top of it is vulnerable. Most successful break-ins go through outdated CMS installations and extensions, not the kernel. Decide who applies updates and how often, and keep test and production environments separate. Subscribe to the security advisories for the software you use so you do not learn about critical vulnerabilities from an incident.
- Update CMS, frameworks and extensions promptly, and remove unused plugins.
- Use strong, unique passwords for administrative access and databases.
- Enable two-factor authentication, including for the provider's customer panel.
- Limit write permissions in the file system to what is necessary.
- Restrict admin interfaces, for example by IP filter or upstream authentication.
- Check uploads and do not store them in the web server's executable area.
What does the host take care of, and what not?
That depends on the product. With an unmanaged server, the standard for VPS and dedicated servers, the provider is responsible for the data center, hardware, network connectivity and provisioning the operating system. Updates, configuration, firewall, backups and applications are then down to you. With managed offerings or web hosting the provider takes on more of this. The service description says exactly what. Clarify this before booking, because it determines your ongoing workload. An emergency access route helps if one of your own changes blocks access: with dedicated servers from Realtoxmedia you can still reach the system via IPMI even if the firewall is set too strictly.
How does DDoS protection complement system hardening?
System hardening protects against intrusion, but not against overload. A volumetric attack makes even a correctly configured server unreachable, because the connection is saturated before traffic reaches the operating system. Defence therefore has to happen in the network, before the traffic reaches your port. Protection should be active automatically on all IP addresses and not only after you report an incident. At Realtoxmedia, basic DDoS protection via our own AS207252 backbone is included on every IP at no extra charge. For services that must stay reachable throughout an attack, extended DDoS protection is available as a paid upgrade. Rate limits in the application are a useful addition to catch smaller, targeted request floods.
Securing a server is ongoing work. Current packages, SSH with keys, a restrictive firewall, few running services and tested backups cover most of the risk. Monitoring, maintained applications and DDoS protection in the network cover the rest.