Fix T1098.004 (#2193)

Fix for systems with multiple authorized keys. Without quotes, the echo command separates new lines with space instead of new line character which breaks authorized_keys file in case there are multiple keys in the file.
This commit is contained in:
jmac774
2022-10-18 18:51:15 +02:00
committed by GitHub
parent 4abb614556
commit da55a259c9
+1 -1
View File
@@ -15,6 +15,6 @@ atomic_tests:
name: bash
elevation_required: false
command: |
if [ -f ~/.ssh/authorized_keys ]; then ssh_authorized_keys=$(cat ~/.ssh/authorized_keys); echo $ssh_authorized_keys > ~/.ssh/authorized_keys; fi;
if [ -f ~/.ssh/authorized_keys ]; then ssh_authorized_keys=$(cat ~/.ssh/authorized_keys); echo "$ssh_authorized_keys" > ~/.ssh/authorized_keys; fi;
cleanup_command: |
unset ssh_authorized_keys