From b7b6bdc9e0748ff7657e1e2b14527a863f27b349 Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Thu, 22 Feb 2024 13:01:13 +0000 Subject: [PATCH] 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. --- test/units/testsuite-74.ssh.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/units/testsuite-74.ssh.sh b/test/units/testsuite-74.ssh.sh index 70fb9ce56c..5d87d9f7ac 100755 --- a/test/units/testsuite-74.ssh.sh +++ b/test/units/testsuite-74.ssh.sh @@ -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