Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Parallel SSH in Python

I wonder what is the best way to handle parallel SSH connections in python. I need to open several SSH connections to keep in background and to feed commands in interactive or timed batch way. Is this possible to do it with the paramiko libraries? It would be nice not to spawn a different SSH process for each connection.

Thanks.


1 Answers

It might be worth checking out what options are available in Twisted. For example, the Twisted.Conch page reports:

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.

like image 144
ars Avatar answered Jun 18 '26 01:06

ars



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!