Paramiko 相当于管道控制和输入/输出管道
我需要一种基于 paramiko 的文件传输方法,使用轻量级 SSH2 服务器(< a href="http://matt.ucc.asn.au/dropbear/dropbear.html" rel="nofollow noreferrer">dropbear) 不支持 SCP 或 SFTP< /a>.有没有办法实现 cat 和重定向样式文件传输,例如:
ssh server "cat remote_file" > local_file
使用 paramiko 通道?
paramiko.Transport.open_channel() 或 Message() 可以完成这项工作吗?我不确定如何继续。
I need a method of paramiko based file transfer with a lightweight SSH2 server (dropbear) which has no support for SCP or SFTP. Is there a way of achieving a cat and redirect style file transfer, such as:
ssh server "cat remote_file" > local_file
with paramiko channels?
Can paramiko.Transport.open_channel() or Message() do the job? I am unsure of how to proceed.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果正如您所说,限制仅存在于您的客户端中,您可以直接使用 paramiko 轻松实现 SFTP 客户端 - 例如,看看这个 示例代码。
If the limitation, as you say, is only in your client, you can easily implement a SFTP client directly with paramiko -- e.g., look at this example code.
pyfilesystem 在之上实现了 sftp 文件系统帕拉米科。
pyfilesystem implements an sftp filesystem on top of paramiko.