diff --git a/Linux/SSH/secure_ssh.sh b/Linux/SSH/secure_ssh.sh index c23ae3e..0f85638 100644 --- a/Linux/SSH/secure_ssh.sh +++ b/Linux/SSH/secure_ssh.sh @@ -523,6 +523,16 @@ EOL log "Prüfe SSH-Konfiguration..." +# Stelle sicher, dass das Privilege‑Separation‑Verzeichnis existiert +if [ ! -d /run/sshd ]; then + warn "/run/sshd fehlt - erstelle Verzeichnis..." + sudo mkdir -p /run/sshd + sudo chown root:sys /run/sshd || sudo chown root:root /run/sshd + sudo chmod 0755 /run/sshd + log "/run/sshd wurde erstellt." +fi + + # Überprüfe, ob die Konfiguration gültig ist if command -v sshd &> /dev/null; then if ! sudo sshd -t &> /dev/null; then