Servers, Hosting & DevOps

Server security & hardening

Hardening is unglamorous and mostly consists of turning things off. Fewer open ports, fewer accounts, fewer services running as root, fewer credentials that never expire. The measurable goal is a smaller attack surface, not a longer list of installed security tools.

The second half matters just as much: detection. Plenty of compromised servers ran for months because nobody was reading the logs, and the first sign of trouble was a hosting provider suspending the account for outbound spam.

What is included

The work itself

Access control

Key-only SSH, root login disabled, a non-standard port where it reduces noise, and per-person accounts so actions are attributable.

Firewalling

Default-deny inbound with only required ports open, CSF or UFW configured deliberately, and administrative interfaces restricted by source address where practical.

Brute-force protection

Fail2ban or LFD on SSH, mail and application login endpoints, with thresholds that stop attacks without locking out staff.

Patch management

Unattended security updates for the OS, a documented cadence for the things that cannot auto-update, and version tracking for the application stack.

File and permission audit

Correct ownership, no world-writable directories, immutable configuration where appropriate, and integrity monitoring on key paths.

Application-layer protection

ModSecurity with a maintained rule set, sensible upload restrictions, and disabling the PHP functions that only ever appear in web shells.

Logging and alerting

Central log collection, alerts on authentication anomalies and privilege escalation, and retention long enough to investigate after the fact.

Incident response

If something has already happened: containment, evidence preservation, clean-up, and a written account of how it got in.

How I work on it

Process

Adjusted to the job, but this is the shape it usually takes.

  1. Baseline

    Establish what is running and what is exposed before changing anything, so improvements are measurable.

  2. Reduce surface

    Remove unused services and accounts first. This is the highest-value, lowest-risk step and it is skipped surprisingly often.

  3. Layer defences

    Network, host and application controls, on the assumption that any single layer can fail.

  4. Verify detection

    A deliberately triggered alert to confirm monitoring works. Untested alerting is a false sense of security.

Questions

Things people ask

No, and it should never be the only measure. It does cut log noise from automated scanners considerably, which makes genuine intrusion attempts easier to spot. Useful as hygiene, useless as a defence.

Common signals: outbound mail volume you cannot account for, unfamiliar cron entries, processes running from /tmp or /dev/shm, modified system binaries, and unexpected outbound connections. A compromised host cannot be fully trusted to report on itself, so serious cases get checked from outside.

I do configuration review and hardening rather than adversarial penetration testing. For a formal pentest with a report you can hand to an auditor, you want a specialist firm, and I am happy to fix what they find.

Need help with server security & hardening?

Tell me the situation and what you have already tried. I read the code and the server before quoting anything.

Get in touch