[Twisted-Python] Conch: multiple commands

Brendan Simon Brendan at BrendanSimon.com
Thu Feb 9 19:42:26 EST 2006

twisted-python-request at twistedmatrix.com wrote:
> Date: Thu, 09 Feb 2006 10:14:20 -0500
> From: Paul Swartz <paulswartz at gmail.com>
> Brendan Simon wrote:
>> I'm trying to use and understand the latest Twisted and Conch (I'm a 
>> newbie).  I can get teh sample apps going fine but they all seem to send 
>> one command and then exit.  I'm trying to workout how to send multiple 
>> commands to the server from the same client application.
>> The sshsimpleclient.py does send multiple commands (false, true, cat) 
>> with separate channels.
>> Is that the preferred way to send multiple commands?
>> Doesn't that require some setup overhead every time I want to issue a 
>> command to the server?
> That's the way SSH requires sending multiple commands.  It does require 
> some server overhead, but there's no way around that.
So what does a normal ssh client (eg openssh) do when I connect to an 
sshd server to get to a bash session ???

Maybe I just answered my own question.  The sshd server runs "login" (or 
something) which in turn looks in /etc/passwd for the user and shell, 
and then invokes that shell (eg. bash).  Is that the way it works?  i.e. 
the ssh client only sends _one_ command and as far as it is concerned is 
only invoked one program and it doesn't care that the server has fired 
off many apps.

If that's the case, then maybe I can invoke bash as my command, and just 
write data to the channel and grab the results ???
Is that good or bad???


More information about the Twisted-Python mailing list