I have downloaded the SSH agent plugin and the default SSH build plugin, as well as configured the global credential. However, this issue occurs during the execution of sshagent (credentials: ['1 '])
in the pipeline. Do I need to install any additional plugins? Or other reasons?
Is the sshg-agent installed at all on the machine where you try to run the pipeline?
And is it found in the path?
Afaik on windows, you must ensure that the ssh-agent from git is found in the path as the one that comes with windows is not returning the proper output that allows the plugin to kill the ssh-agent process after usage
1.Yeah,Iβm in windows,I guess I have installed at all,see following screenshot of Manage Jenkins.
2.And is it found in the path?
emβ¦I donβt know how to check this in Jenkins
3.you must ensure that the ssh-agent from git
I have setup the path of the cmd folder of git in my system path variable.below was files under the cmd folder ,
βββ git
β βββ cmd
β β βββ git.exe
β β βββ start-ssh-agent.cmd
β β βββ start-ssh-pageant.cmd
And I can through ssh(the one that comes with windows) instruction to connect my server.
probably was this
Do you know how to ensure ssh-agent from git when I useing pipeline like this?
stage('Deploy') {
steps {
script {
bat "ssh -o StrictHostKeyChecking=no `UserName@ipAddress` -p `portNumber` 'echo Hello World!'"
}
}
}
Thanks
On my machine, the stuff from git is found at C:\Program Files\Git\usr\bin
. So you will need to include this directory in the path. This can be done either globally in windows for all users, just for the user running the Jenkins agent or by adding a corresponding env setting in the node properties. (Check the help for node env variables how to extend the path).