Python 的 SSH 模块
我必须在远程计算机上完成一项工作(使用我的 Web 服务器),大约需要 10 分钟。
我在 python 中使用了 pxssh 模块,但它给了我“超时错误”(非阻塞) )。
现在,我正在使用 paramiko 但一旦给出指令就会返回。
我希望网络服务器等待作业完成。有没有可用的 python SSH 模块。
或者
我们可以通过更改 pxssh
或 paramiko
的任何配置设置来实现相同的目的吗?
I have to do a job (using my web server) on a remote machine that takes about 10 minutes.
I have used pxssh module in python for the same but it gives me "timeout error"(non blocking).
Now, I am using paramiko but that comes back as soon as it gives the instruction.
I want the web server to wait till the job is complete. Is there any python SSH module available for this.
Or
Can we achieve the same by changing any configuration settings of pxssh
or paramiko
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
recv_exit_status
方法等待命令完成:
例如:
You can use the
recv_exit_status
method on the Channel to wait for the command to complete:For example: