SSH Connection error

Hi team Facing below error while configuring SSH
Failed to connect or change directory

jenkins.plugins.publish_over.BapPublisherException: Failed to connect and initialize SSH connection. Message: [Failed to connect session for config [10_226_110_118_Prod]. Message [Session.connect: java.net.SocketException: Connection reset]]

Can i know the reason

Connection reset usually means there is some network error or your configuration is incorrect. Are you sure the system name is correct, the username/password are correct, etc. Connection reset means that there was a TCP RST packet sent, so something is off in your setup most likely. Without more information about your setup, it will be very difficult to help.

1 Like

Hi
We are using username / password for connection.Source and destination server are AWS and telent is working fine on port 22.
Can you please share any steps required to configure at destination end if we are using Username and password.

Hello @tharun456 ,

telnet on port 22? What about ssh?

Hi
Port 22 is for SSH connection right?

As far as I know, yes, that’s the port we usually use for ssh and not telnet.

for checking connection from jenkins server to destination server on port 22 .i have done telent its working fine but. getting below error in console while checking connection.

jenkins.plugins.publish_over.BapPublisherException: Failed to connect and initialize SSH connection. Message: [Failed to connect session for config [10_226_110_118_Prod]. Message [Session.connect: java.net.SocketException: Connection reset]]

When you say telnet is working fine to port 22, what do you mean? You are able to connect, or something else?

Hi getting below error.

C:\Users\XXXXX>ssh xxxxx\bsgauth@10.xx.xxx.xxx
Connection reset by 10.xx.xx.xx port 22

please help why connection reset is occuring .is issue with jenkins or destination server

1 Like

If you can’t ssh outside of jenkins, then it’s not a jenkins issue.

Use ssh -v to enable more debugging. Check server logs and firewalls. Talk to your ops team. Google “how to debug ssh connection reset”. Etc

1 Like

Hi Team
Thanks for your assistance.After reinstalling SSH on server .I can able to connect.