![](/img/trans.png)
[英]paramiko Incompatible ssh peer (no acceptable kex algorithm)
[英]Paramiko - Incompatible SSH server (no acceptable macs)
我已經使用paramiko一段時間了,並且一切都按預期工作,但是當我退出測試環境時,在打開ssh會話時出現此錯誤
paramiko.ssh_exception.SSHException: Incompatible ssh server (no acceptable macs)
找出錯誤后,我注意到在遠程服務器上,我的/etc/ssh/sshd_config
文件中缺少某些條目。 我的設置都沒有列出這些MAC:
但是,它在一個而不是另一個中起作用。 是什么原因造成的? 我沒有在任何一個中保存rsa密鑰(遠程服務器不允許寫入)。
遠程服務器的sshd_config
#
# Allow Ciphers and MACs
#
Ciphers aes256-ctr,aes192-ctr,aes128-ctr,arcfour256,arcfour128
MACs umac-64@openssh.com,hmac-ripemd160,hmac-sha2-512,hmac-sha2-256
RemoteAccess.py
class RemoteAccess():
def __init__(self, host="abc123", username="abc", password="123"):
self.name = host
self.client = paramiko.SSHClient()
self.client.load_system_host_keys()
self.client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
self.client.connect(host, username=username, password=password)
我引用的鏈接:
由於某些原因,paramiko1.15.1會抱怨不兼容的MAC。 paramiko1.16.0沒有。 通過將1.16.0文件復制到其安裝位置來解決此問題。
/usr/lib/python2.7/site-packages/paramiko
可以在以下位置找到paramiko版本的Changelog: http : //www.paramiko.org/changelog.html
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.