Paramiko SSH Tunnel Shutdown Issue

前端 未结 4 880
萌比男神i
萌比男神i 2021-02-10 23:36

I\'m working on a python script to query a few remote databases over an established ssh tunnel every so often. I\'m fairly familiar with the paramiko library, so that was my cho

4条回答
  •  孤独总比滥情好
    2021-02-11 00:05

    You can also try sshtunnel it has two cases to close tunnel .stop() if you want to wait until the end of all active connections or .stop(force=True) to close all active connections.

    If you don't want to use it you can check the source code for this logic here: https://github.com/pahaz/sshtunnel/blob/090a1c1/sshtunnel.py#L1423-L1456

提交回复
热议问题