From 0b0ab8a9c41056c4c40dac33023c8c4bae6e3a99 Mon Sep 17 00:00:00 2001 From: Stas Yakobov Date: Mon, 27 Feb 2023 13:22:22 +0200 Subject: [PATCH] 20230227.1322 --- 99-ssh-keys.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/99-ssh-keys.sh b/99-ssh-keys.sh index 9fcd682..bb790e2 100755 --- a/99-ssh-keys.sh +++ b/99-ssh-keys.sh @@ -27,10 +27,7 @@ if [ ! -f "$user_authorized_keys_file" ]; then exit 1 fi -# Reads the user file line by line and adds the key to the authorized_keys file -file=$user_authorized_keys_file -while IFS= read -r line || [ -n "$line" ]; do - echo $line >$udm_authorized_keys_file -done <"$file" +# Overwrite /root/.ssh/authorized_keys with $DATA_DIR/ssh/authorized_keys +echo "$(cat "$user_authorized_keys_file")" >"$udm_authorized_keys_file" exit 0