· Henning Scholand · Proxmox  · 3 Min. Lesezeit

Proxmox Host absichern — Angriffsfläche systematisch reduzieren

SSH-Hardening, Fail2ban, 2FA und Kernel-Härtung für Proxmox-Hosts. Eine vollständige Checkliste mit allen Konfigurationsdateien.

SSH-Hardening, Fail2ban, 2FA und Kernel-Härtung für Proxmox-Hosts. Eine vollständige Checkliste mit allen Konfigurationsdateien.

Ein frisch installierter Proxmox-Host ist kein sicherer Proxmox-Host. Die Standardkonfiguration ist auf Funktionalität ausgelegt, nicht auf Sicherheit. Wer produktiv geht, ohne zu härten, gibt Angreifern unnötige Angriffsfläche.

SSH absichern

SSH ist der primäre Remote-Zugang. Gleichzeitig ist er das primäre Angriffsziel.

# /etc/ssh/sshd_config — vollständige Härtung

# Nur SSH-Protokoll 2
Protocol 2

# Kein Root-Login über SSH
PermitRootLogin no

# Kein Passwort-Login — nur Keys
PasswordAuthentication no
ChallengeResponseAuthentication no
UsePAM yes

# Dedizierter SSH-User (kein root, kein www-data)
AllowUsers pveadmin

# Idle-Verbindungen trennen
ClientAliveInterval 300
ClientAliveCountMax 2

# Kein X11-Forwarding
X11Forwarding no

# Keine leeren Passwörter
PermitEmptyPasswords no

# LoginGraceTime reduzieren
LoginGraceTime 30
# SSH-Schlüssel für pveadmin einrichten
useradd -m -s /bin/bash pveadmin
mkdir -p /home/pveadmin/.ssh
chmod 700 /home/pveadmin/.ssh
echo "ssh-ed25519 AAAA... dein-public-key" > /home/pveadmin/.ssh/authorized_keys
chmod 600 /home/pveadmin/.ssh/authorized_keys
chown -R pveadmin:pveadmin /home/pveadmin/.ssh

# pveadmin darf sudo für PVE-Befehle
echo "pveadmin ALL=(ALL) NOPASSWD: /usr/sbin/pvesh, /usr/sbin/qm, /usr/sbin/pct" > /etc/sudoers.d/pveadmin

systemctl restart ssh

Fail2ban für Proxmox konfigurieren

apt install fail2ban -y
# /etc/fail2ban/jail.d/proxmox.conf

[proxmox]
enabled  = true
port     = https,8006
filter   = proxmox
backend  = systemd
maxretry = 3
findtime = 600
bantime  = 3600

[sshd]
enabled  = true
port     = ssh
maxretry = 3
findtime = 300
bantime  = 7200
# /etc/fail2ban/filter.d/proxmox.conf
[Definition]
failregex = pvedaemon\[.*\]: authentication failure; rhost=<HOST> user=.* msg=.*
ignoreregex =
systemctl enable --now fail2ban
fail2ban-client status proxmox

2FA mit TOTP aktivieren

Proxmox unterstützt TOTP nativ — keine externe Abhängigkeit nötig:

# Per CLI für einen User:
pveum user tfa add <user>@pve --type totp
# QR-Code erscheint — mit Authenticator-App scannen

Um 2FA für alle Logins zu erzwingen (Realm-Level):

# TFA für den pve-Realm erzwingen
pveum realm modify pve --tfa type=totp

Unnötige Services deaktivieren

# rpcbind — nur nötig für NFS v3
systemctl disable --now rpcbind rpcbind.socket

# postfix auf localhost einschränken
postconf -e "inet_interfaces = loopback-only"
systemctl restart postfix

# Welche Services lauschen?
ss -tlnp

Kernel-Hardening via sysctl

# /etc/sysctl.d/99-proxmox-hardening.conf

# IP-Spoofing verhindern
net.ipv4.conf.all.rp_filter = 1
net.ipv4.conf.default.rp_filter = 1

# ICMP-Redirects ablehnen
net.ipv4.conf.all.accept_redirects = 0
net.ipv4.conf.default.accept_redirects = 0
net.ipv6.conf.all.accept_redirects = 0

# Source-Routing deaktivieren
net.ipv4.conf.all.accept_source_route = 0
net.ipv4.conf.default.accept_source_route = 0

# SYN-Flood-Schutz
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_max_syn_backlog = 2048

# Kernel-Pointer nicht nach /proc leaken
kernel.kptr_restrict = 2

# dmesg nur für root
kernel.dmesg_restrict = 1

# Core Dumps einschränken
fs.suid_dumpable = 0
sysctl --system
# Überprüfen
sysctl net.ipv4.conf.all.rp_filter

Hardening-Checkliste

[ ] SSH: PasswordAuthentication no
[ ] SSH: PermitRootLogin no
[ ] SSH: AllowUsers gesetzt
[ ] Fail2ban: proxmox + sshd jail aktiv
[ ] 2FA: TOTP für alle Admin-User aktiv
[ ] rpcbind deaktiviert (wenn kein NFS v3)
[ ] sysctl-Härtung angewendet
[ ] ss -tlnp: keine unerwarteten Dienste
[ ] Proxmox-Webinterface nur aus Management-Netz erreichbar (Firewall aus Artikel 3)

Im nächsten Teil erweitern wir die Härtung auf Cluster-Ebene: Corosync-Verschlüsselung, Zertifikate und Audit-Logging.

Zum Blog

Ähnliche Artikel

Alle Artikel »