diff --git a/Init-Server.sh b/Init-Server.sh index c2344e9..6f9861b 100644 --- a/Init-Server.sh +++ b/Init-Server.sh @@ -116,3 +116,22 @@ if [[ -z "$nodejs_input" || "$nodejs_input" =~ ^[Yy]$ ]]; then else log_skip "Node.js-Installation übersprungen." fi + +# Installiere und konfiguriere UFW +log_info "UFW (Uncomplicated Firewall) wird installiert und konfiguriert..." + +# Überprüfen, ob UFW bereits installiert ist +if command -v ufw &> /dev/null; then + log_info "UFW ist bereits installiert." +else + # Installiere UFW + apt install -y ufw + + # Erlaube SSH-Verbindungen + ufw allow ssh + + # Aktiviere UFW + echo "y" | ufw enable + + log_success "UFW wurde erfolgreich installiert und konfiguriert. SSH-Verbindungen sind erlaubt." +fi