Thanks Chris, For time being i used ssh-keygen and transferred it to the main server .ssh/authorized_keys.
On May 21, 4:15 pm, Christopher Orr <[email protected]> wrote: > Hi there, > > This question is probably better suited to the jenkinsci-users mailing list. > > On 05/20/2012 09:46 AM, Salut wrote: > > > I am trying to execute SSH on a remote server, which includes a > > gateway server in between to contact it. I was not able to run my > > commands directly on the main server. I should do a SSH to the gateway > > server and then from there the main server. I am using the existing > > SSH plugins available in Jenkins through which i could connect to > > gateway server. But I couldn't write one more SSH shell script since > > the main server requires password and SSH doesn't allow sending > > password in command line. > > You should set up public-key authentication to your SSH servers, rather > than requiring passwords. > > However, if you really must hardcode an SSH password, you can use > sshpass -- it should be packaged for most distros. > > Alternatively, if Jenkins respects the ssh_config(5) file (I don't know > whether it does), you could get rid of the SSH script by wrapping this > up in a Host config like this: > > Host <slave-hostname> > Ciphers arcfour > ProxyCommand sshpass -p<gw-pass> ssh <gw-user>@<gw-host> nc %h %p > > Then you could just set up the remote slave hostname, username and > password in the Jenkins UI and it should magically work, tunnelling > through the gateway server. > > Regards, > Chris
