[Twisted-Python] SSH connection

Schollnick, Benjamin Benjamin.Schollnick at usa.xerox.com
Fri Feb 27 11:18:55 EST 2004


	I am attempting to use Twisted, for a simple SSH connection...

	As a example, I am using "The Transport" example from the how

from twisted.conch import error
from twisted.conch.ssh import transport
from twisted.internet import defer

class ClientTransport(transport.SSHClientTransport):

    def verifyHostKey(self, pubKey, fingerprint):
        if fingerprint != 'b1:94:6a:c9:24:92:d2:34:7c:62:35:b4:d2:61:11:84':
            return defer.fail(error.ConchError('bad key'))
            return defer.succeed(1)

    def connectionSecure(self):
        self.requestService(ClientUserAuth('user', ClientConnection()))

But....  It appears that something was not installed with the installer?

Traceback (most recent call last):
  File "C:\develope\versions\test_code\ssh_test.py", line 2, in ?
    from twisted.conch.ssh import transport
line 37, in ?
    from Crypto import Util
ImportError: No module named Crypto

I am assuming that there is a prequiste package that needs to be installed,
presumably one of the multitude of Cryptography packages that I find on the
Vaults of Parnassus....

Is this accurate?

And if so, what package?

On the assumption it is PyCrypto....  I tried to install PyCrypto...

(The sad thing is that I'm running through all these hoops simply because I 
need to be able to make a SSH connection, and be able to read and write
to the stream... (ala Telnetlib))

when I:

	setup.py install

I receive:

	C:\develope\pycrypto-1.9a6>setup.py install
	running install
	running build
	running build_py
	running build_ext
	error: Python was built with version 6 of Visual Studio, and
extensions need to
	be built with the same version of the compiler, but it isn't

	Now I am running:

	Python 2.3.2 (#49, Oct  2 2003, 20:02:00) [MSC v.1200 32 bit
(Intel)] on win32
	Type "help", "copyright", "credits" or "license" for more

I also have win32-157 installed....

Is there some way around this compile issue, does anyone know of a
Windows binary for the PyCrypto kit??

		- Benjamin

More information about the Twisted-Python mailing list