TEST-74-AUX-UTILS: Support credential-provided root SSH public key

When root authorized keys are provided by mkosi they are not
newline-terminated so appending a public key to the file results
in a corrupt key, so just to be safe we add an empty line.
This commit is contained in:
Richard Maw
2024-05-06 10:58:24 +02:00
committed by Daan De Meyer
parent 904fc035cb
commit b7b6bdc9e0
+3 -1
View File
@@ -32,7 +32,9 @@ removesshid() {
ssh-keygen -N '' -C '' -t rsa -f "$ROOTID"
mkdir -p 0700 /root/.ssh
cat "$ROOTID".pub >> /root/.ssh/authorized_keys
# Add a newline in case authorized_keys wasn't terminated correctly.
echo >>/root/.ssh/authorized_keys
cat "$ROOTID".pub >>/root/.ssh/authorized_keys
# set root pw to "foo", just to set it to something valid
# shellcheck disable=SC2016