我试图使用以下代码通过Pysftp模块连接到SFTP服务器
a = pysftp.Connection('xx.yyy.zz.abc',username='abcd',password='xyz@123',log=True)这会引发以下错误
NotImplementedError Traceback (most recent call last)
<ipython-input-6-5d0f8343a8c2> in <module>()
----> 1 a = pysftp.Connection('xx.yyy.zz.abc',username='abcd',password='xyz@123',log=True)
C:\Python27\lib\site-packages\pysftp.pyc in __init__(self, host, username, private_key, password, port, private_key_pass, ciphers, log)
160 if password is not None:
161 # Using Password.
--> 162 self._transport.connect(username=username, password=password)
163 else:
164 # Use Private Key.
C:\Python27\lib\site-packages\paramiko-1.15.2-py2.7.egg\paramiko\transport.pyc in connect(self, hostkey, username, password, pkey, gss_host, gss_auth, gss_kex, gss_deleg_creds)
976 self._preferred_keys = [hostkey.get_name()]
977
--> 978 self.start_client()
979
980 # check host key if we were given one
C:\Python27\lib\site-packages\paramiko-1.15.2-py2.7.egg\paramiko\transport.pyc in start_client(self, event)
404 e = self.get_exception()
405 if e is not None:
--> 406 raise e
407 raise SSHException('Negotiation failed.')
408 if event.is_set():
NotImplementedError: Use module Crypto.Signature.pkcs1_15 instead我已经使用这一行代码好几个月了,但是这个错误只是最近才出现的。
即使现在,我也可以使用WINSCP连接到端口。
谢谢你的帮助
发布于 2016-03-15 12:05:59
看起来最好的方法是使用https://github.com/paramiko/paramiko库本身。
这个库并不像它上面的pysftp包装器那么简单,但是有一些非常全面的示例可以基于:https://github.com/paramiko/paramiko/tree/master/demos。
https://stackoverflow.com/questions/36009437
复制相似问题