Hardening a Linux VPS: SSH Keys, UFW & Fail2ban (Beginner Walkthrough)

Опубликовано: 15 Август 2026
на канале: KageSec
44
0

A new server gets probed within minutes of getting a public IP. In this first episode of KageSec, I spin up a fresh Ubuntu 24.04 box on Hetzner and lock it down step by step — SSH key-only login, a non-root admin user, UFW, fail2ban, and automatic security updates. I'm learning this alongside you, not presenting as an expert — correct me in the comments if I get something wrong.

Hetzner Cloud: https://console.hetzner.cloud

WHAT WE COVER
00:00 Intro
Create a CX22 server (Ubuntu 24.04) on Hetzner
Generate an SSH key pair and attach it to the server
Lock down access with a Hetzner Cloud Firewall
First login, patching, hostname/timezone setup
Create a non-root sudo user and set up its SSH access
Lock the root account
Harden sshd_config (key-only auth, modern ciphers, rate limits)
UFW host firewall
fail2ban for brute-force protection
Unattended security upgrades
Daily-use SSH config shortcut

Next episode: PAM + 2FA, a real firewall walkthrough, kernel hardening, and eventually full-disk encryption.

Not sponsored — just the host I'm using for this series.

#linux #sysadmin #cybersecurity #hetzner #ssh #ubuntu #devops