2
votes

I configured in jenkins pre-build step--> Execute shell script on remote host using ssh

Before the build i want execute the below script I am getting below error can anyone have idea and if any information i missed please let me know Actually the below script is to stop the server [EnvInject] - variables injected successfully

executing script cd /home/appsusr; ./ims-carte-stop.sh

[ssh] Exception:Auth fail
com.jcraft.jsch.jschException: Auth fail
     at com.jcraft.jsch.session.connect(session.java.452)
     at com.jcraft.jsch.session.connect(session.java.150)
     at org.jvnet.hudson.plugins.SSHSite.createSession(SSHSite.java:114)
     at org.jvnet.hudson.plugins.SSHSite.executeCommand(SSHSite.java:124)
     at org.jvnet.hudson.plugins.SSHBuilder.perform(SSHBuilder.java.51)
     at hudson.tasks.BuildStepMonitor$Runner.perform(BuildStepMonitor.java.19)
     at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java.700)
3
can any body please respond to this post - phanikumar Raja

3 Answers

1
votes

I ran into a similar issue and how I fixed it was to add a cmdline switch when starting up jenkins. I set the (long winded) -Dorg...useCLI=true

nohup java -Dorg.jenkinsci.plugins.gitclient.Git.useCLI=true -jar jenkins.war > jenkins.log 2>&1 &

The gist of it is that this switch makes jenkins use installed git, not a JGit client.

Hope that helps.

Also, here's a URL to check out (especially long trail of comments)

https://issues.jenkins-ci.org/browse/JENKINS-17204

0
votes

I faced the similar issue after I changed the password of Remote Linux machine.

Updating Passphrase/Password in Credentials section of a Job as well as under Manage Jenkins -> Configure Sytem -> SSH remote hosts worked for me.

0
votes

Ran into this today. I could ssh from within Jenkins to two systems but not the third, all with shared credentials. It turned out the /etc/ssh/sshd_config on the failing system had "PasswordAuthentication no". This caused the correctly reported Auth fail.

HTH