grycap / im

Infrastructure Manager
https://www.grycap.upv.es/im
GNU General Public License v3.0
59 stars 21 forks source link

Study replace paramiko with ssh2-python #689

Open micafer opened 5 years ago

micafer commented 5 years ago

https://parallel-ssh.org/post/ssh2-python/

alahiff commented 5 years ago

Do you know if ssh2-python supports multiplexing? I'm asking because I don't think paramiko does (see https://github.com/paramiko/paramiko/issues/852). I've encountered issues with one cloud where IM's ssh connections to an Ansible node in that cloud trigger DoS protection in their site firewall and then block IM's IP address temporarily. They told me that using ssh configuration like this:

ControlMaster auto
ControlPath ~/.ssh/socket/ssh_mux_%h_%p_%r
ControlPersist 30m

would solve the problem, but it seems that this can't be done with paramiko.

micafer commented 4 years ago

There are some issues installing this package that complicates their usage. There are other library: python-libssh2 available in most of the linux distributions. The problem is that it is a bit old, and does not have maintenance for a long time. https://github.com/wallix/pylibssh2