Member-only story
5 Linux Hardening Techniques I Apply Before Hosting Any Website
--
Share
(After this topic, read “5 More Techniques to Lock Down Public-Facing Linux Servers”)
✍️ Full Blog Content:
Intro:
Hosting a website on Linux isn’t just about setting up Apache or Nginx — it’s about making sure your server doesn’t get turned into someone else’s playground. Over the years, I developed a personal checklist: five hardening techniques I apply every single time before a site goes live.
If you skip these, you’re inviting trouble.
1. Move SSH to a Non-Standard Port and Harden Config
Attackers scan port 22 constantly. One of the first things I do:
✅ Steps:
sudo nano /etc/ssh/sshd_config
- Change port to something like 2210
- set
PermitRootLogin no PasswordAuthentication no AllowUsers youradminuser
✅ Restart SSH:
sudo systemctl restart sshd
🔒 Bonus Tip: Whitelist your IP range in firewall rules if possible.
Top comments (0)