Some things that Python uses SSH under WindowsTime 2014-01-24 17:48:43 Bamboo Shop Original http://blog.xanahopper.com/linux/win-python-ssh/theme ssh Windows python
Python uses SSH under Windows A number of things # why
The leaves I recently toss openSUSE, the new Ben arrived, really lazy to toss many systems, so get a virtual machine, openSUSE feel is good, in Windows with Putty (by the way, must use English version) really ... How a good word.
Cough, pull away ... So, under the ST3, ready to toss, write a plug-in, write a good script directly to the virtual machine with SSH, and then remote execution ...
Incidentally, I am lazy winpython ... Toss
Install SSH first, use PIP directly
Pip Install SSH
The goods need to be pycrypto, will be installed automatically, and then ... A whole bunch of me on the wood have a closer look and run the script directly
#!/usr/bin/env python
import ssh
# New sshclient
client = ssh. Sshclient ()
# Default accept unknown keys
client.set_missing_host_key_policy (SSH. Autoaddpolicy ())
# Connect
client.connect ("192.168.17.128", port=22, Username= "Xana", password= ' xxxxxxx ')
# Execute Shell remotely
stdin, stdout, stderr = Client.exec_command ("Ls-alh")
print (Stdout.read ())
Ctrl+b ... Error.
Can't find crypto......ssh to quote it, OK, look carefully, site-packages under Crypto folder to Crypto, and then.
Ctrl+b ... Error. Python told me I couldn't find crypto.random, and I looked at it and there was really nothing in the bag ... Strange.
Pip Uninstall Crypto
And then come back.
Pip Install Pycrypto
This time the eye is discerning, see error ... Unable to find Vcvarsall.bat, OK, feelings pycrypto this goods incredibly also to compile, estimate is for efficiency. The core parts are written in C ...
Google a bit, here mentioned the solution, for his second plan to install vs I was very simple, VS2013 old already installed, calculate, should be VC110, open lib/distuils/msvc9compiler.py, find Toolskey, Change the assigned part directly into
Toolskey = "Vs110comntools"
Install Pycrypto again, compile successfully, fix.