}
}
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")
///////////////////////////////////////////////////////////////////////////////////////