zozo.host Logo
zozo.host Logo
AIZ.to Best Dedicated Hosting 2026
EDITOR'S CHOICE AIZ.to 2026 ★★★★★
Rated 4.9/5 • Best Dedicated Hosting
Security & VPS

Securing Your Linux Cloud VPS: SSH Keys, UFW Firewall & Fail2ban

Updated Nov 19, 2026 • 2 min read • 235 views • Verified by Systems NOC

Hardening Your Production Cloud VPS

Exposing an unhardened server to the public internet attracts automated botnets within minutes. This step-by-step security blueprint hardens your Ubuntu/Debian server against unauthorized access and volumetric brute-force assaults.

1. Update System Packages

sudo apt update && sudo apt upgrade -y

2. Create a Non-Root Sudo User

# Create user and assign sudo privileges
sudo adduser zozo_admin
sudo usermod -aG sudo zozo_admin

# Copy authorized SSH keys from root to new user
sudo mkdir -p /home/zozo_admin/.ssh
sudo cp ~/.ssh/authorized_keys /home/zozo_admin/.ssh/
sudo chown -R zozo_admin:zozo_admin /home/zozo_admin/.ssh
sudo chmod 700 /home/zozo_admin/.ssh
sudo chmod 600 /home/zozo_admin/.ssh/authorized_keys

3. Configure UFW (Uncomplicated Firewall)

# Set default policies: block incoming, allow outgoing
sudo ufw default deny incoming
sudo ufw default allow outgoing

# Allow essential web and administration ports
sudo ufw allow 22/tcp comment 'SSH'
sudo ufw allow 80/tcp comment 'HTTP'
sudo ufw allow 443/tcp comment 'HTTPS'

# Enable firewall
sudo ufw enable
sudo ufw status verbose

4. Install and Configure Fail2ban

Fail2ban dynamically monitors auth logs and bans malicious IP addresses after repeated failed login attempts via iptables:

sudo apt install fail2ban -y
sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
sudo systemctl enable fail2ban
sudo systemctl start fail2ban

5. Disable SSH Root Password Login

Edit /etc/ssh/sshd_config and update the following directives:

PermitRootLogin prohibit-password
PasswordAuthentication no
PubkeyAuthentication yes

Restart the SSH daemon: sudo systemctl restart sshd.

Was this technical guide helpful?
Thank you for your feedback!

Ready to deploy high-concurrency infrastructure?

Launch AMD EPYC NVMe Cloud VPS with automated OS installation, free DDoS mitigation, and 99.99% uptime SLA.

Verified Technology Partners & Cloud Fabrics
Explore Infrastructure Providers →
cPanel
LiteSpeed
CloudLinux
AMD EPYC
Intel Xeon
Ubuntu
Debian
AlmaLinux
Docker
Kubernetes
NVIDIA
Cloudflare
Let's Encrypt

ZOZO.HOST Cloud & Tech Dispatch

Stay ahead with bi-weekly NVMe benchmarks, network updates, and exclusive cloud discounts.

Double Opt-in • Zero Spam Manage Preferences