[Twisted-Python] Executing a number of commands over SSH

James Brady james at webmynd.com
Sat Jun 14 19:08:58 EDT 2008


Hi all,
I'd like to run a few commands on a remote machine over SSH. Looking  
at the conch packages, I'm not sure what the best approach is for this.

The only way I can see to pass the set of commands down into the  
SSHConnection and SSHChannel objects is through my transport factory,  
i.e. I can't add or remove commands to be run on an already  
instantiated SSHConnection.

Also, I'm a newcomer to the Twisted way of doing things, so it's not  
clear to me how I would go about returning the status and output of  
these commands back up to my code. I'm guessing I should create a  
Deferred somewhere, but some guidance on how these should bubble up  
through the twisted layers would be much appreciated.

Thanks,
James




More information about the Twisted-Python mailing list