How to create a ssh tunnel using python and paramiko?

后端 未结 5 728
攒了一身酷
攒了一身酷 2020-12-02 13:13

I\'m learning python. I need to tunnel creators to read information from a database and close the tunnel. I use paramiko but I have not worked with tonelem example. please g

5条回答
  •  甜味超标
    2020-12-02 13:52

    I used sshtunnel for my projects. Example of the forwarding remote local MySQL port to the host local port:

    pip install sshtunnel
    python -m sshtunnel -U root -P password -L :3306 -R 127.0.0.1:3306 -p 2222 localhost
    

提交回复
热议问题