Update vps-audit.sh

This commit is contained in:
Israel Abebe 2024-12-15 13:00:42 +03:00 committed by GitHub
parent 85a63103aa
commit c6ec8de870
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -144,7 +144,7 @@ fi
# Check SSH default port
UNPRIVILEGED_PORT_START=$(sysctl -n net.ipv4.ip_unprivileged_port_start)
SSH_PORT=$(grep "^Port" /etc/ssh/sshd_config | awk '{print $2}')
SSH_PORT=""
if [ -n "$SSH_CONFIG_OVERRIDES" ] && [ -d "$(dirname "$SSH_CONFIG_OVERRIDES")" ]; then
SSH_PORT=$(grep "^Port" $SSH_CONFIG_OVERRIDES /etc/ssh/sshd_config 2>/dev/null | head -1 | awk '{print $2}')
else