How I Harden My Linux Server in 30 Minutes After Every Fresh Install (Ubuntu & Red Hat) | by Faruk Ahmed | Jul, 2025
Faruk

Faruk @cyberwebpen

About: InfoSec Analyst | 10+ yrs in DLP, CrowdStrike, QRadar, Qualys, Linux Admin, WebLogic Admin | Python & Bash Enthusiast | Passionate about cybersecurity, automation, and continuous learning.

Joined:
Apr 27, 2025

How I Harden My Linux Server in 30 Minutes After Every Fresh Install (Ubuntu & Red Hat) | by Faruk Ahmed | Jul, 2025

Publish Date: Jul 29
0 0

Member-only story

How I Harden My Linux Server in 30 Minutes After Every Fresh Install (Ubuntu & Red Hat)

--

5

Share

Intro: Whether it’s a VM, a fresh cloud server, or a bare-metal deployment — your new Linux server is a blank slate and a target. Before deploying anything, I now follow a fast but effective checklist to lock it down within 30 minutes. In this post, I’ll walk through my routine step-by-step.

1. Update and Upgrade Everything

# Ubuntusudo apt update && sudo apt upgrade -y
Enter fullscreen mode Exit fullscreen mode
# Red Hatsudo dnf update -y
Enter fullscreen mode Exit fullscreen mode

✅ Why? Exploits often target unpatched services. Always start clean.

2. Create a New Admin User (Never Use Root)

sudo adduser adminusersudo usermod -aG sudo adminuser  # Ubuntusudo usermod -aG wheel adminuser  # Red Hat
Enter fullscreen mode Exit fullscreen mode

✅ Then disable direct root SSH access.

sudo nano /etc/ssh/sshd_config# Set:PermitRootLogin no
Enter fullscreen mode Exit fullscreen mode

3. Enable Automatic Security Updates

Ubuntu:

sudo apt install unattended-upgradessudo dpkg-reconfigure --priority=low unattended-upgrades
Enter fullscreen mode Exit fullscreen mode

Red Hat (with dnf-automatic):

sudo dnf install
Enter fullscreen mode Exit fullscreen mode

👉 Read Full Blog on Medium Here

Comments 0 total

    Add comment