How to accept ssh host verification in jenkins ssh agent
If your main concern is with git you could use the GIT_SSH_COMMAND
environment variable. It allows you to inject ssh options:
stage('My git stage') { environment { GIT_SSH_COMMAND = "ssh -o StrictHostKeyChecking=no" } steps { sshagent(['sshuser']) { sh "git clone ssh://git@git.local.com/test/test-commit.git" } }}
Mind you, this comes with some security concerns. You might want to investigate: https://www.symantec.com/connect/articles/ssh-host-key-protection