# Publish Over SSH fail to Connect remote server

**URL:** <https://community.jenkins.io/t/publish-over-ssh-fail-to-connect-remote-server/8149>\
**Category:** Using Jenkins\
**Created:** [June 23, 2023, 7:41am UTC](https://community.jenkins.io/t/publish-over-ssh-fail-to-connect-remote-server/8149 "2023-06-23T07:41:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexvijay](https://avatars.discourse-cdn.com/v4/letter/a/ecae2f/32.png) [@alexvijay](https://community.jenkins.io/u/alexvijay)\
**Post date:** [June 23, 2023, 7:41am UTC](https://community.jenkins.io/t/publish-over-ssh-fail-to-connect-remote-server/8149/1 "2023-06-23T07:41:50Z")

</div>

ill Tack New Server ubuntu 20.4 and Install jenkins Latest Version 2.411and also Install Deploye Over SSh plugin after that im try to add ssh details , after test the connection , im Getting Error Massage like this

**"jenkins.plugins.publish\_over.BapPublisherException: Failed to connect and initialize SSH connection. Message: [Failed to connect session for config [myserver]. Message [Auth fail for methods ‘publickey’]] "**

Im using to add my target private key in that server adding Box

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/jenkins/original/2X/d/d797e0fad0731ca7e8c1b02c1c627baa9af58e42.png)

---

<div class="post-metadata">

**Author:** ![poddingue](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/poddingue/32/985_2.png) [@poddingue](https://community.jenkins.io/u/poddingue)\
**Post date:** [June 23, 2023, 12:45pm UTC](https://community.jenkins.io/t/publish-over-ssh-fail-to-connect-remote-server/8149/2 "2023-06-23T12:45:36Z")

</div>

Hello @alexvijay and welcome to this community! 👋

What about [linux - jenkins.plugins.publish\_over.BapPublisherException: Failed to connect and initialize SSH connection Message [Auth fail] - Stack Overflow](https://stackoverflow.com/a/74567611/2938320) ?

---

<div class="post-metadata">

**Author:** ![notevery](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/notevery/32/5396_2.png) [@notevery](https://community.jenkins.io/u/notevery)\
**Post date:** [September 5, 2023, 8:26am UTC](https://community.jenkins.io/t/publish-over-ssh-fail-to-connect-remote-server/8149/3 "2023-09-05T08:26:57Z")

</div>

jenkins.plugins.publish\_over.BapPublisherException: Failed to connect and initialize SSH connection. Message: [Failed to connect session for config [BPM]. Message [Auth fail for methods ‘publickey,gssapi-keyex,gssapi-with-mic,password’]

this my error log.  
when jenkins upgrade yesterday (from 2.289.3 to 2.241.1) , this error just happened;

---

<div class="post-metadata">

**Author:** ![poddingue](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/poddingue/32/985_2.png) [@poddingue](https://community.jenkins.io/u/poddingue)\
**Post date:** [September 6, 2023, 1:14pm UTC](https://community.jenkins.io/t/publish-over-ssh-fail-to-connect-remote-server/8149/4 "2023-09-06T13:14:42Z")

</div>

Hello @notevery and welcome to this community. 👋

So you downgraded from 2.289.3 to 2.241.1? 🤔
