From: Richard Maw Date: Thu, 22 Feb 2024 13:01:13 +0000 (+0000) Subject: TEST-74-AUX-UTILS: Support credential-provided root SSH public key X-Git-Tag: v256-rc2~97^2~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b7b6bdc9e0748ff7657e1e2b14527a863f27b349;p=thirdparty%2Fsystemd.git 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. --- diff --git a/test/units/testsuite-74.ssh.sh b/test/units/testsuite-74.ssh.sh index 70fb9ce56ca..5d87d9f7acd 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