Back to Missions
BeginnerSystem Security·4–6 hours

Linux Hardening Fundamentals

Secure a fresh Ubuntu server from scratch — configure SSH, set up firewalls, manage users, and eliminate attack surface.

01 Overview

In this mission you'll take a freshly provisioned Ubuntu 22.04 server and harden it against common attack vectors. You'll disable unnecessary services, configure secure SSH access with key-based authentication, set up a stateful firewall with UFW, enforce strong password policies, and enable audit logging. By the end you'll have a repeatable hardening checklist you can apply to any Linux system.

02 Environment Setup

**Option 1 — Local VM (free):** Download [VirtualBox](https://www.virtualbox.org/) and the [Ubuntu 22.04 Server ISO](https://ubuntu.com/download/server). Create a new VM with 2GB RAM and 20GB disk, then install Ubuntu. **Option 2 — Cloud VPS (easiest):** Spin up a free-tier EC2 instance on AWS (t2.micro, Ubuntu 22.04) or a $4/month DigitalOcean Droplet. You'll get SSH access immediately. Once you have access, SSH in and run `sudo apt update && sudo apt upgrade -y` before starting.

03 Mission Tasks

0 of 5 tasks complete0%
01Initial System Audit

Run a baseline security audit using lynis. Document open ports, running services, and current user accounts.

02SSH Hardening

Disable root login, enforce key-based authentication only, change the default port, and configure fail2ban to block brute-force attempts.

03Firewall Configuration

Install and configure UFW. Define an allow-list of required ports (SSH, HTTP, HTTPS) and deny everything else by default.

04User & Permission Management

Create a non-root admin user, configure sudo access with least privilege, and audit file permissions on sensitive directories.

05Audit Logging with auditd

Configure auditd to track privilege escalation, file access on /etc, and login events. Export logs to a centralised location.

04 Why This Matters

Linux hardening is a foundational skill for SOC analysts, cloud security engineers, and DevSecOps engineers. Most cloud workloads run on Linux — knowing how to secure them is non-negotiable.

Ready to start?

Start Mission ↓

Free forever. No account required.

You'll Need

  • A Linux VM or cloud VPS (Ubuntu 22.04 recommended)
  • SSH access with sudo privileges
  • Basic command line familiarity (ls, cd, nano/vim)
  • A terminal on your local machine

Tools & Tech Stack

LinuxBashUFWSSHauditd

Skills You'll Gain

  • Linux administration
  • Firewall configuration
  • SSH security
  • Audit logging
  • Least-privilege principles