使用公司维护助手(python开发)执行巡检,导入主机信息时,发现无法连接,报错信息如下:
2015-12-22 15:41:12,983: 15004 ERROR: paramiko.transport: Exception: Incompatible ssh peer (no acceptable kex algorithm)
2015-12-22 15:41:12,983: 15004 ERROR: paramiko.transport: Traceback (most recent call last):
2015-12-22 15:41:12,983: 15004 ERROR: paramiko.transport: File "paramiko\transport.pyc", line 1584, in run
2015-12-22 15:41:12,983: 15004 ERROR: paramiko.transport: File "paramiko\transport.pyc", line 1663, in _negotiate_keys
2015-12-22 15:41:12,983: 15004 ERROR: paramiko.transport: File "paramiko\transport.pyc", line 1776, in _parse_kex_init
2015-12-22 15:41:12,983: 15004 ERROR: paramiko.transport: SSHException: Incompatible ssh peer (no acceptable kex algorithm)
2015-12-22 15:41:12,983: 15004 ERROR: paramiko.transport:
2015-12-22 15:41:13,000: 6124 ERROR: SSHClient.login: Traceback (most recent call last):
File ".\LIB\Framework\MAProtocols\Communication\MASFTP.py", line 305, in loginViaPwd
File "paramiko\transport.pyc", line 1006, in connect
File "paramiko\transport.pyc", line 464, in start_client
SSHException: Incompatible ssh peer (no acceptable kex algorithm) 搜索发现有人说是paramiko模块版本问题,重试另一台服务器,发现可以连接,排除客户端问题;
想起曾经自动部署工具ideploy连接不上的配置,于是比对/etc/ssh/sshd_conf和/usr/etc/sshd_conf文件,发现能连接上的机器比不能连接上的机器末尾多了一行加密算法
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版本
OS01:~ # ssh -V
OpenSSH_6.9p1, OpenSSL 1.0.1j 15 Oct 2014基本确认与上次JSch程序连接不上原因一致,ssh 6.7以上屏蔽不安全算法,配置即可解决
本文记录了使用Python开发的公司维护助手执行巡检时遇到的SSH连接问题及解决过程。主要原因是SSH版本较高导致的加密算法不兼容问题,通过对比不同服务器的配置文件找到解决方案。

6549

被折叠的 条评论
为什么被折叠?



