V8.13.404.2025.11.10
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 3m10s

Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
2025-11-10 13:40:06 +01:00
parent 52c8fef1d9
commit 41fcb3f6c4
4 changed files with 172 additions and 1 deletions

View File

@@ -12,6 +12,10 @@
set -Ceuo pipefail
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
declare _key="" _old_nullglob=""
_old_nullglob="$(shopt -p nullglob || true)"
shopt -s nullglob
cd /etc/ssh
@@ -86,6 +90,22 @@ Requires=ufw.service
EOF
chmod 0644 /etc/systemd/system/ssh.service.d/override.conf
### Final checks. Verify host keys after installation.
if command -v ssh-keygen >/dev/null 2>&1; then
for _key in /etc/ssh/ssh_host_*key; do
ssh-keygen -lf "${_key}" >/dev/null || exit 1
ssh-keygen -yf "${_key}" >/dev/null || exit 1
done
fi
/usr/sbin/sshd -t || exit 1
eval "${_old_nullglob}" 2>/dev/null || true
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' applied successfully. \e[0m\n" "${0}"
exit 0