From 4ef4419d061615b0e401e10d599fdcd3ee1502d5 Mon Sep 17 00:00:00 2001 From: Mark Beierl Date: Wed, 31 May 2023 14:31:37 -0400 Subject: [PATCH] JSCH workaround for Ubuntu 22.04 Clearly marked workaround code which re-enables ssh-rsa as an accpeted public key algorithm. Change-Id: Iabd67c650d03d9b157b45df1481ccd2643a3beb1 Signed-off-by: Mark Beierl --- jenkins/ci-pipelines/ci_stage_3.groovy | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/jenkins/ci-pipelines/ci_stage_3.groovy b/jenkins/ci-pipelines/ci_stage_3.groovy index 2c2e008b..26f928b0 100644 --- a/jenkins/ci-pipelines/ci_stage_3.groovy +++ b/jenkins/ci-pipelines/ci_stage_3.groovy @@ -442,6 +442,30 @@ node("${params.NODE}") { } } println('VM is ready and accepting ssh connections') + + ////////////////////////////////////////////////////////////////////////////////////////////// + println('Applying sshd config workaround for Ubuntu 22.04 and old jsch client in Jenkins...') + + sh( returnStatus: true, + script: "ssh -T -i ${SSH_KEY} " + + "-o StrictHostKeyChecking=no " + + "-o UserKnownHostsFile=/dev/null " + + "ubuntu@${IP_ADDRESS} " + + "'echo HostKeyAlgorithms +ssh-rsa | sudo tee -a /etc/ssh/sshd_config'") + sh( returnStatus: true, + script: "ssh -T -i ${SSH_KEY} " + + "-o StrictHostKeyChecking=no " + + "-o UserKnownHostsFile=/dev/null " + + "ubuntu@${IP_ADDRESS} " + + "'echo PubkeyAcceptedKeyTypes +ssh-rsa | sudo tee -a /etc/ssh/sshd_config'") + sh( returnStatus: true, + script: "ssh -T -i ${SSH_KEY} " + + "-o StrictHostKeyChecking=no " + + "-o UserKnownHostsFile=/dev/null " + + "ubuntu@${IP_ADDRESS} " + + "'sudo systemctl restart sshd'") + ////////////////////////////////////////////////////////////////////////////////////////////// + } // stage("Spawn Remote VM") /////////////////////////////////////////////////////////////////////////////////////// -- 2.17.1