python - fatal error : Incompatible ssh peer (no acceptable kex algorithm)

标签 python openssl fabric paramiko

运行 fabric python API 并在主机“a-stor1”上看到“ fatal error :不兼容的 ssh 对等体(没有可接受的 kex 算法)”,但在“rack1-app1”上运行良好。我能看到的唯一区别是“rack1-app1”正在运行 openssl 1.0.1-4ubuntu5.3,而“a-stor1”正在运行 1.0.1-4ubuntu5.21。

Brians-MacBook-Pro:initial bohalloran$ python tests/test_fabric.py 
[rack1-app1] Executing task 'testIt'
[rack1-app1] run: uptime
[rack1-app1] out: 13:07:43 up 24 days, 19:18, 1 user, load average: 0.07, 0.05, 0.05
[rack1-app1] out:

[a-stor1] Executing task 'testIt'
[a-stor1] run: uptime
ERROR:paramiko.transport:Exception: Incompatible ssh peer (no acceptable kex algorithm)
ERROR:paramiko.transport:Traceback (most recent call last):
ERROR:paramiko.transport: File "/Library/Python/2.7/site-packages/paramiko/transport.py", line 1614, in run
ERROR:paramiko.transport: self._handler_tableptype
ERROR:paramiko.transport: File "/Library/Python/2.7/site-packages/paramiko/transport.py", line 1694, in _negotiate_keys
ERROR:paramiko.transport: self._parse_kex_init(m)
ERROR:paramiko.transport: File "/Library/Python/2.7/site-packages/paramiko/transport.py", line 1809, in _parse_kex_init
ERROR:paramiko.transport: raise SSHException('Incompatible ssh peer (no acceptable kex algorithm)')
ERROR:paramiko.transport:SSHException: Incompatible ssh peer (no acceptable kex algorithm)
ERROR:paramiko.transport:

Fatal error: Incompatible ssh peer (no acceptable kex algorithm)

Underlying exception:
Incompatible ssh peer (no acceptable kex algorithm)

Aborting.
Incompatible ssh peer (no acceptable kex algorithm)

Underlying exception:
Incompatible ssh peer (no acceptable kex algorithm)
Brians-MacBook-Pro:initial bohalloran$ cat tests/test_fabric.py 
from fabric.api import env, run, prefix, hide, settings
from fabric import tasks
import logging

env.hosts = ['rack1-app1', 'a-stor1']
env.user = 'storiant'
env.password = 'ST0r!ant'

logging.basicConfig()

cmd = 'uptime'

def main():
tasks.execute(testIt)

def testIt():
with settings(warn_only = True):
run(cmd)

if name == "main":
main()
Brians-MacBook-Pro:initial bohalloran$

Brians-MacBook-Pro:initial bohalloran$ python
Python 2.7.6 (default, Sep 9 2014, 15:04:36) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

import paramiko
print paramiko.version
1.15.2
^D
Brians-MacBook-Pro:initial bohalloran$
Brians-MacBook-Pro:initial bohalloran$ openssl version
OpenSSL 0.9.8zd 8 Jan 2015
Brians-MacBook-Pro:initial bohalloran$

storiant@Rack1-app1:~$ openssl version
OpenSSL 1.0.1 14 Mar 2012
storiant@Rack1-app1:~$

storiant@a-stor1:~$ openssl version
OpenSSL 1.0.1 14 Mar 2012
storiant@a-stor1:~$

storiant@a-stor1:~$ dpkg -l | grep libgnutls
ii libgnutls26 2.12.14-5ubuntu3.1 GNU TLS library - runtime library
storiant@a-stor1:~$ dpkg -l | grep openssl
ii libevent-openssl-2.0-5 2.0.16-stable-1ubuntu0.1 Asynchronous event notification library (openssl)
ii openssl 1.0.1-4ubuntu5.21 Secure Socket Layer (SSL) binary and related cryptographic tools
storiant@a-stor1:~$

storiant@Rack1-app1:~$ dpkg -l | grep libgnutls
ii libgnutls26 2.12.14-5ubuntu3.1 GNU TLS library - runtime library
storiant@Rack1-app1:~$ dpkg -l | grep openssl
ii libevent-openssl-2.0-5 2.0.16-stable-1 Asynchronous event notification library (openssl)
ii openssl 1.0.1-4ubuntu5.3 Secure Socket Layer (SSL) binary and related cryptographic tools
storiant@Rack1-app1:~$

storiant@Rack1-app1:~$ uname -a
Linux Rack1-app1 3.2.0-58-generic #88-Ubuntu SMP Tue Dec 3 17:37:58 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
storiant@Rack1-app1:~$

storiant@a-stor1:~$ uname -a
Linux a-stor1 3.2.0-58-generic #88-Ubuntu SMP Tue Dec 3 17:37:58 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
storiant@a-stor1:~$

最佳答案

升级结构为我解决了问题(pip --upgrade fabric)

关于python - fatal error : Incompatible ssh peer (no acceptable kex algorithm),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29754852/

相关文章:

python - 名称错误 : name 'QWebPage' is not defined

python - 使用 Tensorflow 在二元分类中改变准确度值并且不改变损失值

python - 如何以与 shell 无关、与语言无关的方式从命令行获取当前 Linux 进程 ID

python - env.password 在 fab 文件中设置,但进程仍然多次询问 sudo 密码

python - 嵌套类型提示不同的结果

python - PyTorch 的张量是如何实现的?

c - 没有 BIO 的 ASN1_TIME_print 功能?

openssl 忽略序列号扩展名

c - 如何使用 C 中的 openssl 调用解密私钥文件并签署一些文本?

python - 我可以让 fabric 使用 `dzdo su -` 而不是 sudo 吗?