Issue
I want to use scp/ssh to upload some files to a server. I discover that I need to use certificate-based authentication, but the question is how? Really what I want to do is to use the same sort of credentials I use with git - passworded ssh cert stored in Jenkins. However, I can't work out how to - the snippet generator has no obvious option for that.
What do others do? Is there an undocumented feature that would do this?
Solution
If you install the SSH Agent plugin you can use the ssh-agent
pipeline step to run a shell script with an ssh-agent active. The ssh-agent
takes a Jenkins credentials ID (a passworded ssh cert, like the one you have for git).
Answered By - Joep Weijers
Answer Checked By - Cary Denson (JavaFixing Admin)