paramiko在使用的过程中出现下面的错误
>>> ssh.connect(ip,22,"root","passwd")
Exception: Incompatible ssh server (no acceptable macs)
Traceback (most recent call last):
File "D:\python3\lib\site-packages\paramiko-1.13.0-py3.6.egg\paramiko\transpor
t.py", line 1448, in run
self._handler_table[ptype](self, m)
File "D:\python3\lib\site-packages\paramiko-1.13.0-py3.6.egg\paramiko\transpor
t.py", line 1528, in _negotiate_keys
self._parse_kex_init(m)
File "D:\python3\lib\site-packages\paramiko-1.13.0-py3.6.egg\paramiko\transpor
t.py", line 1681, in _parse_kex_init
raise SSHException('Incompatible ssh server (no acceptable macs)')
paramiko.ssh_exception.SSHException: Incompatible ssh server (no acceptable macs
)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "D:\python3\lib\site-packages\paramiko-1.13.0-py3.6.egg\paramiko\client.p
y", line 242, in connect
File "D:\python3\lib\site-packages\paramiko-1.13.0-py3.6.egg\paramiko\transpor
t.py", line 348, in start_client
File "D:\python3\lib\site-packages\paramiko-1.13.0-py3.6.egg\paramiko\transpor
t.py", line 1448, in run
File "D:\python3\lib\site-packages\paramiko-1.13.0-py3.6.egg\paramiko\transpor
t.py", line 1528, in _negotiate_keys
File "D:\python3\lib\site-packages\paramiko-1.13.0-py3.6.egg\paramiko\transpor
t.py", line 1681, in _parse_kex_init
paramiko.ssh_exception.SSHException: Incompatible ssh server (no acceptable macs
产生的原因是因为安装的paramiko模块版本太低
C:\Users\wwx512261>pip freeze
altgraph==0.16.1
certifi==2018.10.15
chardet==3.0.4
crypto==1.4.1
ecdsa==0.13
future==0.16.0
idna==2.7
macholib==1.11
Naked==0.1.31
paramiko==1.13.0
pefile==2018.8.8
pycryptodome==3.7.0
pyinstaller==3.4.dev0+bbf964c6b
pywin32-ctypes==0.2.0
PyYAML==3.13
requests==2.20.0
shellescape==3.4.1
urllib3==1.24.1
xlwt==1.3.0
然后直接升级
pip install paramiko --upgrade
网友评论