问题
I used to create a SOCKS connection between a windows client and linux server using SSH server and putty. However, the firewall between the client and server is now able to identify SSH packets and drop them.
I was wondering if I can emulate such behavior of SSH tunnels using python? Any recommendations on libraries or readings?
Thanks in advance.
回答1:
Yes, yes you can. Pick your poison.
- http://socksipy.sourceforge.net/
- http://sourceforge.net/projects/pysocks/
- http://code.google.com/p/socksipy-branch/
- How can I use a SOCKS 4/5 proxy with urllib2?
- http://google-api-python-client.googlecode.com/hg/docs/httplib2.socks.html
回答2:
You can consider using paramiko for your SSH. Here is a nice link ssh-programming-with-paramiko
You can also try this ssh module which uses paramiko.
来源:https://stackoverflow.com/questions/8997142/emulating-sshs-socks-proxy-tunnel-in-python