[Twisted-Python] ssh client and server

Vasil Vangelovski vvangelovski at gmail.com
Fri Apr 11 16:13:06 EDT 2008


I guess I may be asking a wrong question. What I need is a
client-server protocol that can be very simple. The client logs on to
the server (user,pass) then the client asks  for something from the
server, or sends a small amount of data, the server then returns data
(up to 200k), the server drops the connection. But I also need maximum
protection against sniffing. Which is the best way to acomplish this?

On Fri, Apr 11, 2008 at 5:50 PM,  <cyli at alum.mit.edu> wrote:
> If I understand you correctly, you want a shelless SSH server but one that
> executes commands.  For instance, it will accept the following connection:
>
>  ssh server "echo Hello!"
>
>  But not:
>
>  ssh server
>
>  Is this correct?  I'm did something similar, except that I also reject the
> first type of command.  What I did was to overwrite session.SSHSession's
> request_shell command to terminate the connection instead of returning a
> shell.    And then of course I subclassed ConchUser to return my own session
> (rather than session.SSHSession) for the channelLookup, and wrote my own
> realm that returned my user from requestAvatar.
>
>  There may be a better way to do it, but this is short, and it works. I
> stuck my code up here in case you want to look at it:
> http://cyli.livejournal.com/38382.html
>
>
>
>
>  On 03:08 pm, vvangelovski at gmail.com wrote:
>
> > I did look at that too. In and Ideal situation I'd make a server that
> responds to exec from the client, generates a response for the command and
> sends it back to the client, then drops the connection. But I can't find a
> way to do that.
> >
> > Kuba Konczyk wrote:
> >
> > > Have a look at
> http://twistedmatrix.com/trac/browser/trunk/doc/conch/examples/sshsimpleserver.py
> > >
> > > 2008/4/11, Vasil Vangelovski <vvangelovski at gmail.com>:
> > >
> > > > I want to write a custom ssh server and client. the client should
> > > >  authenticate, execute just one command on the server and get back the
> > > >  response. I've been following the examples from the O'reilly book,
> but
> > > >  I'm kinda lost. Basicaly what I wand to do is use the client from the
> > > >  last example, but a simpler server without a terminal emulator,
> > > >  nothing fancy. Can anyone help?
> > > >
> > >
> > > _______________________________________________
> > > Twisted-Python mailing list
> > > Twisted-Python at twistedmatrix.com
> > > http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
> > >
> >
> >
> > _______________________________________________
> > Twisted-Python mailing list
> > Twisted-Python at twistedmatrix.com
> > http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
> >
>
>  _______________________________________________
>  Twisted-Python mailing list
>  Twisted-Python at twistedmatrix.com
>  http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>




More information about the Twisted-Python mailing list