[Twisted-Python] help ssh forwarding.

Paul Swartz z3p at twistedmatrix.com
Thu Mar 11 11:36:09 EST 2004

On Thu, 2004-03-11 at 09:04, Oisin Mulvihill wrote:
> The solution to this is to forward port 22 on the kiosk to
> a port on the server. I was thinking of just spawning the
> command "ssh -R11122:my_server:22 user at my_server" from the
> kiosk, when ever I need to connect to a machine. However I'm
> hoping to do this with twisted, since the kiosk app uses it
> already, and spawning the ssh command won't play well with
> twisted's event system.

Take a look at reactor.spawnProcess().

> Can anyone suggest what I'm doing wrong? Can twisted actually
> do this?

Well, what you're doing wrong is you're using local->remote forwarding
in your example.  What you want is to ask the server to forward a remote
port over the connection.  Look at twisted.scripts.conch.SSHConnection,
methods requestRemoteForwarding and channel_forwarded_tcpip for an
example of how to implement remote->local forwarding.

      Paul Swartz
(o_   z3p at twistedmatrix dot com
//\   http://www.twistedmatrix.com/users/z3p.twistd/
V_/_  AIM: Z3Penguin

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20040311/9a1576d4/attachment.pgp 

More information about the Twisted-Python mailing list