Security Hardening

Netcup Linux Server: Production Hardening & Performance Setup

Comprehensive baseline hardening guide for Netcup cloud servers running Debian 12 or Ubuntu 24.04. Minimize attack surfaces while maximizing I/O performance.

M
Markus S. (Senior Cloud Infrastructure Engineer)
Verified & Tested: September 2026
⏱️ 9 min read

1. System Update & Timezone

root@netcup-server:~#

# Update package repositories and upgrade existing packages

apt update && apt upgrade -y && apt autoremove -y

# Configure system timezone

timedatectl set-timezone UTC

# Install essential system tools and utilities

apt install -y curl wget git vim htop iotop ufw fail2ban

2. Sudo User & Ed25519 Key Auth

Direct root SSH access is a primary security hazard. Create a dedicated user deployer with administrative sudo privileges:

adduser deployer

usermod -aG sudo deployer

# Set up .ssh directory for user deployer

mkdir -p /home/deployer/.ssh && chmod 700 /home/deployer/.ssh

nano /home/deployer/.ssh/authorized_keys

# Paste your public SSH key, then restrict permissions:

chmod 600 /home/deployer/.ssh/authorized_keys

chown -R deployer:deployer /home/deployer/.ssh

3. Hardening SSH Daemon

Create /etc/ssh/sshd_config.d/99-hardened.conf to disable password-based brute force and customize ports:

/etc/ssh/sshd_config.d/99-hardened.conf

Port 2222

PermitRootLogin no

PasswordAuthentication no

PubkeyAuthentication yes

MaxAuthTries 3

ClientAliveInterval 300

ClientAliveCountMax 2

Validate configuration syntax and restart SSH: sshd -t && systemctl restart ssh

4. UFW Firewall & Fail2ban

# Set default policies and allow custom SSH and web ports

ufw default deny incoming

ufw default allow outgoing

ufw allow 2222/tcp comment "Custom SSH Port"

ufw allow 80/tcp comment "HTTP"

ufw allow 443/tcp comment "HTTPS"

ufw enable

# Enable and start fail2ban service

systemctl enable --now fail2ban

5. Linux BBR & Swap Tuning

Google BBR congestion control substantially enhances TCP throughput over long-haul connections with high latency:

# Write sysctl network and memory optimizations

cat <<EOF > /etc/sysctl.d/99-custom.conf

net.core.default_qdisc = fq

net.ipv4.tcp_congestion_control = bbr

vm.swappiness = 10

vm.vfs_cache_pressure = 50

EOF

# Apply sysctl settings immediately

sysctl --system

# Verify BBR is actively running (should output bbr)

sysctl net.ipv4.tcp_congestion_control

MS
Article Author & Infrastructure Lead10+ Years European Datacenter & Virtualization Practice

Markus S.

Senior Cloud Infrastructure Architect & Linux Sysadmin

Markus focuses on European cloud hosting economics, server performance optimization, and KVM virtualization. All benchmarks, setup guides, and VAT exemption procedures are verified on self-funded Netcup instances hosted in the Nuremberg datacenter (AMD EPYC hardware).

🛡️100% Independent & Self-Funded (No sponsored influence)
Real Hardware Benchmarks (AMD EPYC 9645 / Genoa clusters)
🔄Daily Automated Verification (All promo codes regularly validated)
Editorial Independence & Integrity Policy: Netcup.Discount maintains complete editorial neutrality. While some links may earn referral credit, our benchmarks, configuration advice, and hosting evaluations remain strictly objective.
⚡ Real-time Synced Pool

💰 Netcup Verified Coupons & Discounts

We maintain an updated collection of verified netcup discount codes, with real-time automatic synchronization. Get up to 30% off or free months on your next order.

Browse All Coupons →