ansible报错Incompatible ssh peer (no acceptable kex algorithm)

 在目标服务器上,/etc/ssh/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
# 并重启sshd服务,才能生效
# service sshd restart
Stopping sshd: [ OK ]
Starting sshd: [ OK ]

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

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

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

参考

SSHException: Incompatible ssh peer (no acceptable kex algorithm)_paramiko.sshexception: incompatible ssh peer (no a-CSDN博客
https://blog.csdn.net/coder_xia/article/details/50382278

Incompatible ssh peer (no acceptable kex algorithm-CSDN博客
https://blog.csdn.net/weixin_38920945/article/details/103370034

Ansible常见报错汇总 - 每天进步一点点!!! - 博客园
https://www.cnblogs.com/madsnotes/articles/7412577.html

 

posted @ 2025-05-07 13:53  paul_hch  阅读(177)  评论(0)    收藏  举报