# Auth Fail to deploy to server

**URL:** https://community.jenkins.io/t/auth-fail-to-deploy-to-server/5305
**Category:** Ask a question
**Created:** [January 12, 2023, 11:03am UTC](https://community.jenkins.io/t/auth-fail-to-deploy-to-server/5305 "2023-01-12T11:03:50Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![tharun456](https://avatars.discourse-cdn.com/v4/letter/t/a587f6/32.png) [@tharun456](https://community.jenkins.io/u/tharun456)
#### Post date: [January 12, 2023, 11:03am UTC](https://community.jenkins.io/t/auth-fail-to-deploy-to-server/5305/1 "2023-01-12T11:03:50Z")

</div>

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](https://prod2-29.centralindia.logic.azure.com/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](https://prod2-29.centralindia.logic.azure.com/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

---

<div class="post-metadata">

### Author: ![prakhar08](https://avatars.discourse-cdn.com/v4/letter/p/3e96dc/32.png) [@prakhar08](https://community.jenkins.io/u/prakhar08)
#### Post date: [September 7, 2023, 4:55pm UTC](https://community.jenkins.io/t/auth-fail-to-deploy-to-server/5305/2 "2023-09-07T16:55:33Z")

</div>

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.
