0
votes

Jenkins SSH server showing mentioned error Algorithm negotiation fail while trying to set up with over the SSH plugin when trying to connect over ssh to a local server (Linux Container). I am able to connect using ssh on the terminal.

jenkins.plugins.publish_over.BapPublisherException: Failed to connect and initialize SSH connection. Message: [Failed to connect session for config [anisbleHOST]. Message [Algorithm negotiation fail]]

Ubuntu machine - auth.log Unable to negotiate with xx.xx.xx.x port 39866: no matching host key type found. Their offer: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521 [preauth]

tried with the mentioned below sshd_config values but no luck.

HostKeyAlgorithms [email protected],ssh-ed25519

KexAlgorithms [email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1

1

1 Answers

1
votes

To resolve the above-mentioned issue first I made changes to /etc/ssh/sshd_config and regenerated RSA keys using ssh-keygen. Jenkins doesn't support keys generated using ed25519.

My New sshd_config -

HostKeyAlgorithms [email protected],rsa-sha2-512,rsa-sha2-256,ssh-rsa

HostKey /etc/ssh/ssh_host_key

HostKey /etc/ssh/ssh_host_rsa_key

HostCertificate /etc/ssh/ssh_host_key-cert.pub

KexAlgorithms diffie-hellman-group14-sha1,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,ecdh-sha2-nistp256,ecdh-sha2-nistp384

PubkeyAcceptedKeyTypes ssh-rsa,[email protected],[email protected],ssh-ed25519

TrustedUserCAkeys /etc/ssh/ssh_user_ca.pub

PasswordAuthentication no

ChallengeResponseAuthentication no

UsePAM yes

PrintMotd no

AcceptEnv LANG LC_*

Subsystem sftp /usr/lib/openssh/sftp-server

LogLevel DEBUG


Please UPVOTE if it helps you :)