Browse Source

Make sure authorized_keys is ending with EOL when adding a SSH Key

Jaap Marcus 5 years ago
parent
commit
208936b675
1 changed files with 3 additions and 0 deletions
  1. 3 0
      bin/v-add-user-ssh-key

+ 3 - 0
bin/v-add-user-ssh-key

@@ -51,6 +51,9 @@ if [ ! $? -eq 0 ]; then
     exit
 fi
 rm "$TEMP"
+# make sure authorized_keys is ending with EOL
+sed -i '$a\' "${AUTHKEY_FILE}"
+
 #append key to file
 echo "$key" >> "$AUTHKEY_FILE"