Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4629b58a7e | ||
|
|
d8cd628ddd |
@@ -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";
|
||||
@@ -294,7 +298,7 @@ for ssh_group in "${ssh_groups[@]}"; do
|
||||
printf "${CSV_LINE}" "${account_id}" "${region}" "${instance_id}" "$(hostname)" "${username}" "${main_group}" "${ssh_group}" "${user_create_date_out}" "${account_age}" "${last_login_date}" "${last_login}" "${never_logged_in}" "${login_source}" "${out_string}"
|
||||
;;
|
||||
esac;
|
||||
done <<< "$(grep "${ssh_group}:" /etc/group | cut -d ":" -f 4 | sed -e 's/,/ /g')";
|
||||
done <<< "$(grep "${ssh_group}:" /etc/group | cut -d ":" -f 4 | sed -e 's/,/\n/g')";
|
||||
done;
|
||||
if [ "${OUTPUT_TARGET}" = "text" ]; then
|
||||
if [ -n "${lock_accounts}" ]; then
|
||||
|
||||
Reference in New Issue
Block a user