Merge pull request #144 from trails-cool/chore/harden-sshd

Harden SSH config
This commit is contained in:
Ullrich Schäfer 2026-03-29 22:33:57 +02:00 committed by GitHub
commit 0150c40631
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -41,6 +41,18 @@ resource "hcloud_server" "trails" {
# Create app directory
mkdir -p /opt/trails-cool
# Harden SSH
cat > /etc/ssh/sshd_config.d/99-hardening.conf <<'SSHD'
PasswordAuthentication no
X11Forwarding no
AllowTcpForwarding no
AllowAgentForwarding no
MaxAuthTries 3
ClientAliveInterval 300
ClientAliveCountMax 2
SSHD
systemctl reload ssh
EOF
}