Failed Login Report
Summarise recent failed SSH logins by source address.
$ webtoolist --script ssh-hardening-audit
Inspect sshd configuration for common risky settings without changing anything.
sshsecurityaudithardeningDependencies: sshd, grep
#!/usr/bin/env bash
set -euo pipefail
config="${SSHD_CONFIG:-/etc/ssh/sshd_config}"
[[ -r "$config" ]] || { echo "cannot read $config" >&2; exit 1; }
check() {
local key="$1" want="$2" line
line="$(grep -Ei "^[[:space:]]*${key}[[:space:]]+" "$config" | tail -n1 || true)"
if [[ -z "$line" ]]; then
echo "WARN $key not set explicitly (defaults apply)"
return
fi
local value="${line#*[[:space:]]}"
if [[ "$value" == "$want" ]]; then
echo "OK $key $value"
else
echo "FAIL $key $value (want $want)"
fi
}
check PermitRootLogin no
check PasswordAuthentication no
check PermitEmptyPasswords no
check X11Forwarding no
check MaxAuthTries 3
check ClientAliveInterval 300
echo
echo "== effective configuration =="
sshd -T 2>/dev/null | grep -Ei 'permitrootlogin|passwordauthentication|maxauthtries|allowusers|port ' || true
sudo ./ssh-hardening-audit
SSHD_CONFIG=/etc/ssh/sshd_config.d/10-hardening.conf ./ssh-hardening-audit
sshd -T shows the merged effective config, including Include files.Related scripts
Summarise recent failed SSH logins by source address.
Find world-writable files and directories, excluding known-safe locations.
Run one command on a list of SSH hosts, sequentially, with clear output.
Check PATH for missing, duplicate, or world-writable directories.