I recently upgraded Jenkins from 2.46.2 to 2.426.3.
My config of Publish over SSH stopped working. It uses password authentication. I provided:
- Name [DEV]
- Hostname
- Username
- Password
- Remote directory
- Port (22)
When I click "Test Configuration", the error message is :
jenkins.plugins.publish_over.BapPublisherException: Failed to connect and initialize SSH connection. Message: [Failed to connect session for config [DEV]. Message [Algorithm negotiation fail: algorithmName="kex" jschProposal="curve25519-sha256,[email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,ext-info-c,[email protected]" serverProposal="diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1"]]
Also, when I try to run SSH command ssh user@server in a Git-bash, I have this error:
no matching key exchange method found. Their offer: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
I believe it might be due to different versions of SSH on the client and server :
- In Git-bash : OpenSSH_9.3p1, OpenSSL 3.1.1 30 May 2023
- On destination server : OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008
- On Jenkins servers (main and agent) : OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017