我想知道在 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/