[Twisted-Python] Question about conch.ssh.forwarding

Paul Swartz z3p at twistedmatrix.com
Sun Jan 11 10:39:37 EST 2004


On Sat, Jan 10, 2004 at 09:40:14PM -0500, Joshua Smith wrote:
> I am working on creating a module for a project involving workstation 
> administration and have been trying to get the ssh port forwarding in 
> conch to work. Anybody have any quick and dirty examples of this? My 
> goal is to be able to forward traffic to our mail server and a central 
> administrative console in a secure fashion. I have had limited success 
> with python controlling the command line ssh, but it is unwieldy 
> compared to doing it natively in python.

Once you have an SSHConnection instance:

reactor.listenTCP(localPortToListenOn,
    forwarding.SSHListenForwardingFactory(conn, (hostToConnectTo,
                                                 portToConnectTo),
                                          SSHListenClientForwardingChannel))

Then you can connect to localPortToListenOn any way you want.

-p
-- 
       Paul Swartz
(o_    http://www.twistedmatrix.com/users/z3p.twistd/  _o)
//\    z3p at twistedmatrix.com                           /\\
V_/_   AIM: z3penguin                                 _\_V->




More information about the Twisted-Python mailing list