本文共 1622 字,大约阅读时间需要 5 分钟。
使用公司维护助手(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 run2015-12-22 15:41:12,983: 15004 ERROR: paramiko.transport: File "paramiko\transport.pyc", line 1663, in _negotiate_keys2015-12-22 15:41:12,983: 15004 ERROR: paramiko.transport: File "paramiko\transport.pyc", line 1776, in _parse_kex_init2015-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_clientSSHException: 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 -VOpenSSH_6.9p1, OpenSSL 1.0.1j 15 Oct 2014基本确认与上次JSch程序连接不上原因一致,ssh 6.7以上屏蔽不安全算法,配置即可解决
转载地址:http://uacqb.baihongyu.com/