<div dir="ltr">Hi,<br><br>I've been playing around with Twisted's Conch client (which looks extremely well done, thanks!). I've been able to connect to a conch server and also connect to other ssh servers and execuate various commands. I'd like to be able to connect to an arbitrary SSH server and run /bin/bash.<br>
<br>I'm able to execute a command like so:<br><br>---------------------<br>class CommandChannel(channel.SSHChannel):<br> ....<br> def channelOpen(self, data):<br> self.conn.sendRequest(<br> self, 'exec', common.NS(self.command), wantReply=True).addCallback(<br>
self._gotResponse)<br>---------------------<br><br>Looking through the SSH spec (connect protocol, rfc4254), it looks like shells are opened with this command. <br><br>---------------------<br><br><pre> byte SSH_MSG_CHANNEL_REQUEST<br>
uint32 recipient channel<br> string "shell"<br> boolean want reply<br></pre>
---------------------<br><br>It doesn't look like Conch supports these requests (here's how CHANNEL_REQUESTs are currently sent out)<br><br>---------------------<br>(Twisted-8.1.0)<br>twisted/conch/ssh/connection.py (413):<br>
self.transport.sendPacket(MSG_CHANNEL_REQUEST, struct.pack('>L',<br> self.channelsToRemoteChannel[channel])<br> + common.NS(requestType)+chr(wantReply)<br>
+ data)<br>---------------------<br><br>I may be misunderstanding how remote shells are started, so any help would be appreciated. <br><br>Again, I'm trying to launch an interactive /bin/bash shell from a Conch SSH client on an arbitrary remote SSH server. <br>
<br>Thanks for your time.<br><br>Best Regards,<br>Bill Zeller<br></div>