paramiko: SSH port forwarding to get SQL dump

一世执手 提交于 2019-11-29 11:41:29

I recently wrote an SSHForwarder class that does what you want:

https://gist.github.com/1399529

To use it you can do something like this:

    try:
        proxy_host = 'PX'
        proxy_user = 'PXusr'
        target_port = RMTport
        target_host = 'RMT'
        f = SSHForwarder(proxy_host, target_port, target_host, proxy_user)
        # .... DO SOME STUFF ....
    finally:
        if f:
            f.close()
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!