From 02425e4b31698c5ec7016061c72ffe061b62a74ca32933ea71ab3e95b166731d Mon Sep 17 00:00:00 2001 From: "Marc S. Weidner" Date: Fri, 24 Oct 2025 13:55:53 +0100 Subject: [PATCH] V8.13.288.2025.10.24 Signed-off-by: Marc S. Weidner --- lib/lib_hardening_ultra.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/lib_hardening_ultra.sh b/lib/lib_hardening_ultra.sh index a14b07c..c2223d5 100644 --- a/lib/lib_hardening_ultra.sh +++ b/lib/lib_hardening_ultra.sh @@ -197,7 +197,7 @@ hardening_ultra() { ### /config/includes.chroot/etc/ssh/sshd_config # shellcheck disable=SC2155 declare pad="$(printf '%-29s' 'Port')" - sed -E -i "s|^[[:space:]]*#?[[:space:]]*(Port[[:space:]]+PORT_MUST_BE_CHANGED)[[:space:]]*$|${pad}${sshport}|" "${VAR_HANDLER_BUILD_DIR}/config/includes.chroot/etc/ssh/sshd_config" + sed -i -E "/PORT_MUST_BE_CHANGED/ s|.*|${pad}${sshport}|" "${VAR_HANDLER_BUILD_DIR}/config/includes.chroot/etc/ssh/sshd_config" ### /config/hooks/live/9950_fail2ban_hardening.chroot sed -i "s|PORT_MUST_BE_SET|${sshport}|g" "${VAR_HANDLER_BUILD_DIR}/config/hooks/live/9950_fail2ban_hardening.chroot" @@ -246,7 +246,7 @@ hardening_ultra() { ### /config/includes.chroot/etc/ssh/sshd_config # shellcheck disable=SC2155 declare pad="$(printf '%-29s' 'Port')" - sed -E -i "s|^[[:space:]]*#?[[:space:]]*(Port[[:space:]]+PORT_MUST_BE_CHANGED)[[:space:]]*$|${pad}${sshport}|" "${VAR_HANDLER_BUILD_DIR}/config/includes.chroot/etc/ssh/sshd_config" + sed -i -E "/PORT_MUST_BE_CHANGED/ s|.*|${pad}${sshport}|" "${VAR_HANDLER_BUILD_DIR}/config/includes.chroot/etc/ssh/sshd_config" ### /config/hooks/live/9950_fail2ban_hardening.chroot sed -i "s|PORT_MUST_BE_SET|${sshport}|g" "${VAR_HANDLER_BUILD_DIR}/config/hooks/live/9950_fail2ban_hardening.chroot"