jjb: Enable the use of .ssh/authorized_keys2 when building images
[lttng-ci.git] / pipelines / images / imagebuild.sh
index 45632c0514c365dd0811a5eac196c5c5158825c8..befc9bf0fb2f1e302b0901f486f9246c686b71ae 100644 (file)
@@ -173,6 +173,10 @@ CLEANUP+=(
     "rm -f ${HOME}/.ssh/id_rsa"
 )
 lxc file push ~/.ssh/id_rsa.pub "ci:${INSTANCE_NAME}/root/.ssh/authorized_keys2"
+# Some distros, eg. Rocky Linux, don't enable the use of authorized_keys2
+# by default
+lxc exec "ci:${INSTANCE_NAME}" -- bash -c 'if test -f /etc/redhat-release ; then sed -i "s#^AuthorizedKeysFile.*#AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys2#" /etc/ssh/sshd_config ; systemctl restart sshd ; fi'
+
 
 # Confirm working SSH connection
 if ! ssh "${INSTANCE_IP}" hostname ; then
This page took 0.023547 seconds and 4 git commands to generate.