fix: Check authorized_keys change failed

This commit is contained in:
wangruidong 2025-03-17 19:16:25 +08:00 committed by w940853815
parent f4fa153ffa
commit f5a2f5e538

View File

@ -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