Auth Fail to deploy to server

Hi Team
We are facing issue while deploying to the server from jenkins.Below mentioned the error:
Can please confirm when this error occur : End of Pipeline com.jcraft.jsch.JSchException: Auth fail at

Success code from [100‥399] [Pipeline] } [Pipeline] // stage [Pipeline] stage [Pipeline] { (Deploy to PROD) [Pipeline] sshPublisher SSH: Connecting from host [AWP] SSH: Connecting with configuration [badlavserverPROD] … SSH: Disconnecting configuration [badlavserverPROD] … SSH: Transferred 1 file(s) [Pipeline] withCredentials Masking supported pattern matches of %identity% or %% or %EBLServiceRequest% [Pipeline] { [Pipeline] sshCommand Executing command on dotnetcore[10.224.142.91]: C:\Jenkins\Tools\deployBadlaavProd.bat sudo: false [Pipeline] } [Pipeline] // withCredentials [Pipeline] httpRequest HttpMethod: POST URL: https://prod2-29.centralindia.logic.azure.com:443/workflows/9c9e801553cc4884840af45cb943cd18/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=v1H0Q0_i5mFa4MvI6GAbos2dmNcB3Al72yLfdKDaQsU Content-Type: application/json Sending request to url: https://prod2-29.centralindia.logic.azure.com:443/workflows/9c9e801553cc4884840af45cb943cd18/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=v1H0Q0_i5mFa4MvI6GAbos2dmNcB3Al72yLfdKDaQsU Response Code: HTTP/1.1 202 Accepted Response: Success code from [100‥399] [Pipeline] } [Pipeline] // stage [Pipeline] } [Pipeline] // node [Pipeline] End of Pipeline com.jcraft.jsch.JSchException: Auth fail at com.jcraft.jsch.Session.connect(Session.java:519) at com.jcraft.jsch.Session.connect(Session.java:183) at com.jcraft.jsch.Session$connect$1.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117) at org.hidetake.groovy.ssh.connection.ConnectionManager.connectInternal(ConnectionManager.groovy:107) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Native

Hi Tharun,

The issue could be due to following reasons:

  1. Incorrect pair of public and private key being used in authentication process. Kindly make sure you use the correct key pair.

  2. Issue could be due to remote host dosen’t support the ssh key algorithm which jenkins hosted server is using to ssh into the remote host. In my case it was ‘ssh-rsa’.

If you have access to the remote host you can do the following:
step 1: open the file /etc/ssh/sshd_config in text editor such as vim, nano etc.
step 2: Paste the following line PubkeyAcceptedAlgorithms +ssh-rsa in the bottom of the file. This will allow “ssh-rsa” keys to authenticate to your server through the jenkins pipeline.

Important Note: please do it carefully as sshd service is very critical. Its better to take expert help and make the backup of the config file before editing it.

step 3: Restart the sshd service.