系统:ubuntu 22.04
错误消息:
jenkins.plugins.publish_over.BapPublisherException: Failed to connect and initialize SSH connection.
Message: [Failed to connect session for config [cati-p01(业务server ) 10.180.3.38].
Message [Algorithm negotiation fail: algorithmName="kex" jschProposal="curve25519-sha256,curve25519-sha256@libssh.org,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,kex-strict-c-v00@openssh.com"
serverProposal="diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,kex-strict-s-v00@openssh.com"]]
解决方法:
vim /etc/ssh/sshd_config
最下面添加两行:
HostKeyAlgorithms ssh-dss,ssh-ed25519,ssh-rsa,rsa-sha2-256,rsa-sha2-512 KexAlgorithms curve25519-sha256@libssh.org,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
重启SSH,
sudo systemctl restart ssh 即可解决问题。