gpt4 book ai didi

python - Python 中的并行 SSH

转载 作者:太空宇宙 更新时间:2023-11-03 13:06:19 24 4
gpt4 key购买 nike

我想知道在 python 中处理并行 SSH 连接的最佳方法是什么。我需要打开几个 SSH 连接以保留在后台并以交互式或定时批处理方式提供命令。这可以用 paramiko 库来做吗?最好不要为每个连接生成不同的 SSH 进程。

谢谢。

最佳答案

可能值得检查一下 Twisted 中可用的选项。例如,Twisted.Conch 页面报告:

http://twistedmatrix.com/users/z3p/files/conch-talk.html

Unlike OpenSSH, the Conch server does not fork a process for each incoming connection. Instead, it uses the Twisted reactor to multiplex the connections.

关于python - Python 中的并行 SSH,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1185855/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com