2

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)
1
  • can any body please respond to this post Commented Jan 26, 2013 at 18:11

4 Answers 4

2

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

Sign up to request clarification or add additional context in comments.

1 Comment

I wanted to use keyfile only auth so I turned this off. Looks like jenkins' ssh client needs this on for some reason. Thank you for helping me.
1

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

Comments

0

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.

Comments

0

This issue may come from /run/nologin. /run/nologin is created by systemd-tmpfiles-setup.service. It is then removed by systemd-user-sessions.service.

So you have to delete this:

$ ls -l /run/nologin
# rm /run/nologin

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.