VPN & Security 20 February 2026 11 min read Frankfurt, Germany

How to Secure Your
Germany VPS — 10-Step Guide

A new VPS receives its first brute-force attack within 60–120 seconds of going live. This 10-step guide hardens your Frankfurt VPS against automated attacks in under 30 minutes — SSH keys, firewall, Fail2ban, and more.

Why VPS Security Matters More Than Ever in 2026

A freshly deployed Linux VPS is being scanned by automated bots within minutes of going live. Honeypot research consistently shows that a new server with a public IP receives its first SSH brute-force attempt within 60–120 seconds of deployment. In 2026, AI-powered attack tools scan millions of IPs per hour looking for default credentials, unpatched services, and misconfigured servers.

The good news: securing a Germany VPS properly takes less than 30 minutes and makes your server effectively impenetrable to the 99.9% of automated attacks that use predictable techniques. This guide covers the 10 most impactful security hardening steps — in order of priority.

Before you start: Keep your current SSH session open in one terminal while making changes. Test each change in a second terminal window. Locking yourself out is a real risk if you misconfigure SSH or the firewall — always test before closing your working session.

Step 1 — Update Everything Immediately

The first and most important security action. Unpatched software is the single biggest vulnerability on most VPS servers. Run immediately after first login:

Bash — Ubuntu/Debian
apt update && apt upgrade -y && apt autoremove -y
# Set up automatic security updates
apt install -y unattended-upgrades
dpkg-reconfigure --priority=low unattended-upgrades
# Choose "Yes" to enable automatic security updates

Step 2 — Create a Non-Root User

Running everything as root is a significant security risk. Create a regular user with sudo privileges for daily administration:

Bash
# Create a new user (replace 'yourname' with your chosen username)
adduser yourname
usermod -aG sudo yourname
# Copy SSH keys to new user (if using key auth)
rsync --archive --chown=yourname:yourname ~/.ssh /home/yourname
# Test: open a new terminal and connect as the new user
ssh yourname@YOUR_VPS_IP

Step 3 — Configure SSH Key Authentication

SSH keys are exponentially more secure than passwords. If not already done, set up key-based authentication:

Bash — On your local machine
# Generate Ed25519 key (if you don't have one)
ssh-keygen -t ed25519 -C "germany-vps"
# Copy public key to VPS
ssh-copy-id yourname@YOUR_VPS_IP

Step 4 — Harden SSH Configuration

Disable password authentication and restrict SSH access. This is your most impactful single security action:

Bash — Edit /etc/ssh/sshd_config
nano /etc/ssh/sshd_config

# Change / add these lines:
PasswordAuthentication no         # Keys only — eliminates brute force
PermitRootLogin prohibit-password  # Root only with key, not password
X11Forwarding no                  # Disable X11 forwarding
MaxAuthTries 3                     # Limit failed attempts
LoginGraceTime 20                  # 20 second login timeout
AllowUsers yourname               # Whitelist specific users
ClientAliveInterval 300           # Disconnect idle sessions after 5min
ClientAliveCountMax 2

# Restart SSH (test in second terminal first!)
systemctl restart ssh

Optional: Change SSH port. Add Port 2222 (or any high port) to sshd_config to reduce automated scanning noise. Remember to open the new port in UFW and update your client SSH config. This alone eliminates ~95% of brute force attempts targeting port 22.

Step 5 — Configure UFW Firewall

UFW (Uncomplicated Firewall) provides a simple interface to iptables. Enable it with a minimal set of allowed ports:

Bash
apt install -y ufw
# Set defaults: deny all incoming, allow all outgoing
ufw default deny incoming
ufw default allow outgoing

# Allow only what you need
ufw allow 22/tcp      # SSH (change to your custom port if applicable)
ufw allow 80/tcp      # HTTP (only if running web server)
ufw allow 443/tcp     # HTTPS (only if running web server)

# Enable firewall
ufw enable
ufw status verbose    # Verify rules are correct

Step 6 — Install and Configure Fail2ban

Fail2ban monitors log files and automatically bans IP addresses that show malicious behaviour — repeated failed login attempts, port scanning, etc. It is essential even after disabling password SSH, because it protects other services:

Bash
apt install -y fail2ban
# Create local config (overrides default, survives updates)
cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
nano /etc/fail2ban/jail.local

# In [DEFAULT] section, set:
# bantime  = 3600    (ban for 1 hour)
# findtime = 600     (look back 10 minutes)
# maxretry = 3       (ban after 3 failures)

# In [sshd] section, ensure:
# enabled = true
# port = 22  (or your custom port)

systemctl enable --now fail2ban
fail2ban-client status sshd  # Check SSH jail is active

Step 7 — Disable Unused Services

Every running service is a potential attack surface. Disable anything you do not need:

Bash
# List all running services
systemctl list-units --type=service --state=running

# Common services to disable if not needed:
systemctl disable --now bluetooth  # Not on VPS
systemctl disable --now avahi-daemon # mDNS — not needed on VPS
systemctl disable --now cups        # Printer service — not on VPS

# List open ports to see what's exposed
ss -tlnp    # Shows all listening TCP ports and which process owns them

Step 8 — Set Up Automatic Security Updates

Critical security patches should be applied automatically — delayed patching is the #1 cause of server compromises in the wild:

Bash
nano /etc/apt/apt.conf.d/50unattended-upgrades

# Ensure these are uncommented/set:
# Unattended-Upgrade::Allowed-Origins {
#     "${distro_id}:${distro_codename}-security";
# };
# Unattended-Upgrade::Automatic-Reboot "false";
# Unattended-Upgrade::Remove-Unused-Packages "true";

# Enable auto-updates:
nano /etc/apt/apt.conf.d/20auto-upgrades
# Add:
# APT::Periodic::Update-Package-Lists "1";
# APT::Periodic::Unattended-Upgrade "1";

Step 9 — Configure Login Notifications

Get an email or log entry whenever someone logs into your Germany VPS:

Bash — Add to /etc/profile or /root/.bashrc
# Add to /etc/profile for all users:
echo 'echo "Login from $(who | awk '"'"'{print $5}'"'"') at $(date)" >> /var/log/login-audit.log' >> /etc/profile

# Or use PAM for more robust login auditing:
apt install -y libpam-exec
# Add to /etc/pam.d/sshd:
# session optional pam_exec.so /usr/local/bin/notify-login.sh

Step 10 — Regular Security Audits

Security is not a one-time task. Run these checks regularly:

Bash — Security audit commands
# Check for failed login attempts
grep "Failed password" /var/log/auth.log | tail -20

# Check which IPs Fail2ban has banned
fail2ban-client status sshd

# Check for listening ports (should only see what you expect)
ss -tlnp

# Check for suspicious cron jobs
crontab -l
cat /etc/crontab
ls /etc/cron.d/

# Install and run Lynis security scanner
apt install -y lynis
lynis audit system   # Comprehensive security audit with recommendations

Quick Security Checklist

KVM Isolation Protects You at the Hardware Level
Our Germany VPS uses full KVM hardware virtualisation — even if another tenant's VPS were compromised, KVM's hardware-level isolation prevents any cross-VM escape. Your Germany VPS is an isolated hardware boundary, not just a software sandbox.
Deploy Secure Germany VPS from $3/mo

Frequently Asked Questions

Honeypot research shows automated bots typically reach a new public IP within 60–120 seconds. SSH brute-force attempts on port 22 begin almost immediately. This is why the first thing you should do after deploying a Germany VPS is: update packages, set up SSH key auth, disable password auth, and enable UFW. Do this before deploying any services.
Yes — Fail2ban protects more than just SSH. It also protects web servers (Nginx, Apache), mail servers, FTP, and any other service with authentication. Even with SSH keys, Fail2ban prevents log flooding from brute-force attempts and provides visibility into who is attacking your server. Install it on every VPS regardless of authentication method.
Yes — network-level DDoS mitigation is active on all Germany VPS plans at no extra cost. Basic volumetric attacks are filtered at our Frankfurt network perimeter before reaching your server. For application-layer DDoS protection (Layer 7), using Cloudflare's free plan in front of your web server provides excellent additional protection.
Previous
What Is KVM Virtualization?
Previous
What Is KVM Virtualization?