[Twisted-Python] Making a Persistent SSH connection w/ Conch - How?

J French hikenboots at gmail.com
Tue Aug 23 12:33:35 EDT 2005


I'm trying to design a ssh client that establishes a connection that
it persistent until I close it so that I can use it for constant
bi-directional communication.  I want it to act like a shell with a
gui top of it (wxPython).  I think I need to keep a channel open
continuously to effect this.  This is my first attempt at using ssh so
I'm probably missing some important paradigms here, please fill me in
if possible.  I grabbed the the sshsimpleclient.py code from
http://twistedmatrix.com/projects/conch/documentation/examples/sshsimpleclient.py
 and modified (to test the behavior):

    def closed(self):
        print 'got data from cat: %s' % repr(self.data)
        #self.loseConnection()
        #reactor.stop()

The server connection still closes as soon as I receive the callback
data. I'm using freebsd and it works as advertised (I see the
connection in auth.log but of course, its closed before I can 'who'
and check it out)  Any advice on the right way to get started would be
appreciated!

-John




More information about the Twisted-Python mailing list