diff --git a/bin/check_last_login.sh b/bin/check_last_login.sh index ae1987b..7cfbec8 100755 --- a/bin/check_last_login.sh +++ b/bin/check_last_login.sh @@ -111,6 +111,10 @@ for ssh_group in "${ssh_groups[@]}"; do fi; fi; while read -r username; do + # skip empty, if group exists but has no users + if [ "${username}" = "" ]; then + continue; + fi; # check that user exists in passwd if ! id "${username}" &>/dev/null; then out_string="[!] User $username does not exists in /etc/passwd file";