FAIL : SSHException: Incompatible ssh peer (no acceptable kex algorithm)问题解决及更新paromiko失败问题解决;

前言:在今天10:00左右开发反应Jenkins自动抓取日志的构建不能用了;


故障如图所示:

2018-12-28_172342.png

看报错显示: Incompatible ssh peer (no acceptable kex algorithm)", "unreachable": true}  解释:不兼容ssh对等体(不可接受的kex算法)、“不可达”:true。


前几天ssh我们升级了如图所示:左键点击属性查看如下;


spacer.gifTIM图片20181228173436.png

问题描述:运行paromiko连接远程服务器失败:FAIL : SSHException: Incompatible ssh peer (no acceptable kex algorithm)

定位原因:由于ssh 6.7以上屏蔽不安全算法;

解决办法:在/etc/ssh/sshd_config最后加上

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服务,问题解决。 配一张配置文件的图;

2018-12-28_173753.png

因我们的是集群部署所以需要ansible执行 ; 执行命令:ansible -i hosts mobile -m shell -a "/etc/init.d/sshd restart"

11111.png

重新部署jenkins看一下;如图所示:

2018-12-28_174308.png

已经成功完成构建部署;