Skip empty group on login check
This commit is contained in:
@@ -111,6 +111,10 @@ for ssh_group in "${ssh_groups[@]}"; do
|
|||||||
fi;
|
fi;
|
||||||
fi;
|
fi;
|
||||||
while read -r username; do
|
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
|
# check that user exists in passwd
|
||||||
if ! id "${username}" &>/dev/null; then
|
if ! id "${username}" &>/dev/null; then
|
||||||
out_string="[!] User $username does not exists in /etc/passwd file";
|
out_string="[!] User $username does not exists in /etc/passwd file";
|
||||||
|
|||||||
Reference in New Issue
Block a user