From c0e68f83666074142db978d5b594232800c0e598 Mon Sep 17 00:00:00 2001 From: buildplan Date: Sun, 19 Oct 2025 19:19:59 +0100 Subject: [PATCH] trim whitespaces and cleanup --- du_setup.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/du_setup.sh b/du_setup.sh index 29fb339..7290889 100644 --- a/du_setup.sh +++ b/du_setup.sh @@ -1680,7 +1680,7 @@ configure_ssh() { trap cleanup_and_exit ERR print_section "SSH Hardening" - local CURRENT_SSH_PORT USER_HOME SSH_DIR SSH_KEY AUTH_KEYS NEW_SSH_CONFIG + local CURRENT_SSH_PORT USER_HOME SSH_DIR SSH_KEY AUTH_KEYS # Ensure openssh-server is installed if ! dpkg -l openssh-server | grep -q ^ii; then @@ -1707,14 +1707,13 @@ configure_ssh() { SSHD_BACKUP_FILE="$BACKUP_DIR/sshd_config.backup_$(date +%Y%m%d_%H%M%S)" cp /etc/ssh/sshd_config "$SSHD_BACKUP_FILE" - # Check our globally detected port, falling back to 22 if detection failed + # Check globally detected port, falling back to 22 if detection failed if [[ -z "$PREVIOUS_SSH_PORT" ]]; then print_warning "Could not detect an active SSH port. Assuming port 22 for the initial test." - log "Could not detect active SSH port, fell back to 22 (globally)." + log "Could not detect active SSH port, fell back to 22." PREVIOUS_SSH_PORT="22" fi CURRENT_SSH_PORT=$PREVIOUS_SSH_PORT - USER_HOME=$(getent passwd "$USERNAME" | cut -d: -f6) SSH_DIR="$USER_HOME/.ssh" AUTH_KEYS="$SSH_DIR/authorized_keys"