Paramiko:“FutureWarning:CTR 模式需要计数器参数"; [英] Paramiko: "FutureWarning: CTR mode needs counter parameter"

查看:146
本文介绍了Paramiko:“FutureWarning:CTR 模式需要计数器参数";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 Python2 中使用 Paramiko 使用私有 SSH 密钥通过 SFTP 传输文件,但它显示此警告:

I am trying to use Paramiko in Python2 for transferring files through SFTP with a private SSH key but it displays this warning:

/usr/lib/python2.7/dist-packages/Crypto/Cipher/blockalgo.py:141: 
FutureWarning: CTR mode needs counter parameter, not IV   self._cipher = factory.new(key, *args, **kwargs)

实际上它会将文件发送到服务器,但有人能解释一下这个警告是什么意思吗?

In fact it sends the file to the server but can someone explain me what this warning means?

这是我的代码:

t = paramiko.Transport((host, port))
key = paramiko.RSAKey.from_private_key_file("/path/to/key.ssh") 
t.connect(username="username",password=None, pkey=key)

sftp = paramiko.SFTPClient.from_transport(t)
sftp.put(source, destination)

sftp.close()
t.close()

推荐答案

这很可能是 paramiko 中的一个错误

This is most likely a bug in paramiko

您可以尝试使用 paramiko/transport.py">这个补丁使警告消失

You can try to patch paramiko/transport.py with this patch to make the warning go away

另见讨论此处,其中引用了拉取请求.

See also the discussion here which references the pull request.

这篇关于Paramiko:“FutureWarning:CTR 模式需要计数器参数";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆