Home Solutions Industries Portfolio Pricing Blog Affiliate Contact
Quote
← Back to all posts
Linux Server Hardening Checklist: 15 Steps to Secure a New Server
DevOps & Infrastructure

Linux Server Hardening Checklist: 15 Steps to Secure a New Server

BL
BlackCode Admin November 5, 2026 · 2 min read

Automated bots scan the internet constantly. A new server with default settings will see login attempts almost immediately. Hardening reduces the attack surface so those attempts fail.

The checklist

  1. Update everything immediately, and enable automatic security updates.
  2. Create a named admin user and stop using root directly.
  3. Use SSH keys and disable password login.
  4. Disable root login over SSH.
  5. Restrict SSH to known IPs or a VPN where possible.
  6. Enable a firewall allowing only the ports you need (typically 22, 80, 443).
  7. Install fail2ban or similar to block repeated failed logins.
  8. Remove unused services and packages.
  9. Run applications as unprivileged users.
  10. Keep databases private, bound to localhost or a private network.
  11. Set correct file permissions, especially for configuration and secrets.
  12. Enable logging and ship logs off the server.
  13. Synchronise time so logs and certificates work correctly.
  14. Back up automatically to another location and test restores.
  15. Monitor disk, memory, CPU and unusual logins.

Ongoing hygiene

Tired of risky deployments and surprise downtime?

We set up CI/CD, monitoring and infrastructure that lets your team ship calmly.

WhatsApp us+254 731 209 601Book a free demo20 minutes, no costCall us+254 731 209 601
  • Review users and SSH keys quarterly.
  • Patch promptly when critical vulnerabilities are announced.
  • Audit open ports periodically.
  • Rebuild long-lived servers from code when practical.

Automate it

Hardening by hand is error-prone. Capture these steps in a configuration tool or infrastructure code so every new server starts secure and consistent.

Key takeaways

  • Use SSH keys and disable root and password login.
  • Firewall everything you do not need.
  • Patch automatically and monitor continuously.
  • Automate hardening for consistency.

Frequently asked questions

Is changing the SSH port useful?

It reduces noise from bots but is not real security on its own. Keys and firewalls matter more.

Do managed hosting plans handle this?

Some do. Check what is included and what remains your responsibility.

Can you harden our servers?

Yes. We audit and harden servers and set up monitoring.

Tired of risky deployments and surprise downtime?

We set up CI/CD, monitoring and infrastructure that lets your team ship calmly.

WhatsApp us+254 731 209 601Book a free demo20 minutes, no costCall us+254 731 209 601

0 comments 0 likes

Comments (0)

Be the first to comment on this post.