DEV Community

Faruk
Faruk

Posted on • Originally published at Medium

5 More Techniques to Lock Down Public-Facing Linux Servers | by Faruk Ahmed | Apr, 2025

Member-only story

5 More Techniques to Lock Down Public-Facing Linux Servers

--

Share

(Before this read: 5 Linux Hardening Techniques I Apply Before Hosting Any Website)

✍️ Full Blog Content:

Intro:

Hardening Linux isn’t a one-time task — it’s an ongoing discipline. In my last post, I shared 5 techniques I always apply before hosting a public website. Today, I’m sharing 5 more advanced techniques I use to lock down my Linux servers against real-world threats.

If your server faces the internet, these steps are essential — not optional.

1. Implement SSH Key Authentication Only (No Passwords Allowed)

✅ Steps:

# On your client machine:ssh-keygen -t ed25519
Enter fullscreen mode Exit fullscreen mode
# Copy your public key to the server:ssh-copy-id -p 2210 youradmin@yourserverip
Enter fullscreen mode Exit fullscreen mode

✅ Edit SSH config:

sudo nano /etc/ssh/sshd_config
Enter fullscreen mode Exit fullscreen mode

Set:

PasswordAuthentication noPubkeyAuthentication yes
Enter fullscreen mode Exit fullscreen mode

✅ Restart SSH:

sudo systemctl restart sshd
Enter fullscreen mode Exit fullscreen mode

🔒 Why: No password = no bruteforce attacks possible.

2. Set Up Two-Factor…


👉 Read Full Blog on Medium Here

Top comments (0)