From f5a2f5e538c217b4ed4b8ecdb0b194d1fa7c9780 Mon Sep 17 00:00:00 2001 From: wangruidong <940853815@qq.com> Date: Mon, 17 Mar 2025 19:16:25 +0800 Subject: [PATCH] fix: Check authorized_keys change failed --- 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 ff2bd63b0..c1c196d1c 100644 --- a/apps/accounts/automations/gather_account/host/posix/main.yml +++ b/apps/accounts/automations/gather_account/host/posix/main.yml @@ -41,7 +41,7 @@ for user in {{ users.stdout_lines | join(" ") }}; do home=$(getent passwd $user | cut -d: -f6) echo -n "$user:" - if [[ -f ${home}/.ssh/authorized_keys ]]; then + if [ -f "${home}/.ssh/authorized_keys" ]; then cat ${home}/.ssh/authorized_keys | tr '\n' ';' fi echo