From 325edfe7043ddf86b09a5808f3664a5cd2a6338b Mon Sep 17 00:00:00 2001 From: wangruidong <940853815@qq.com> Date: Tue, 18 Mar 2025 18:57:07 +0800 Subject: [PATCH] fix: long_time_no_login account, not listed as risk account --- apps/accounts/automations/gather_account/host/posix/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/accounts/automations/gather_account/host/posix/main.yml b/apps/accounts/automations/gather_account/host/posix/main.yml index c1c196d1c..9ced4d194 100644 --- a/apps/accounts/automations/gather_account/host/posix/main.yml +++ b/apps/accounts/automations/gather_account/host/posix/main.yml @@ -10,7 +10,7 @@ - name: Gather posix account last login ansible.builtin.shell: | for user in {{ users.stdout_lines | join(" ") }}; do - last -i --time-format iso -n 1 ${user} | awk '{ print $1,$3,$4, $NF }' | head -1 | awk 'NF' + last -wi --time-format iso -n 1 ${user} | awk '{ print $1,$3,$4, $NF }' | head -1 | awk 'NF' done register: last_login