Python uses SSH for several things under Windows __python

Source: Internet
Author: User
Tags ssh
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.