Telnet server implementation

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • kumar

    Telnet server implementation

    Hi all,

    I want to write a telnet server for an embedded linux box using
    python.The problem is that it doesn't give a shell ( just a limited
    CLI commands for configuring it . )My requirement is to write a telnet
    server ( residing on the box) listening on some specific port where it
    can listen to telnet requests from clients and provide them an
    interactive command line session. I tried using the python's
    async_chat module but it is very limited ..any wrappers around this
    module so that it can be used more interactively ?? . Any pointers
    would be highly appreciated . The current available CLI on this box
    allows me to write python scripts remotely , ftp it and run them, so
    executing them won't be problem.

    Thanks
    kumar
  • Andrew Bennetts

    #2
    Re: Telnet server implementation

    On Tue, Dec 02, 2003 at 03:49:23AM -0800, kumar wrote:[color=blue]
    > Hi all,
    >
    > I want to write a telnet server for an embedded linux box using
    > python.The problem is that it doesn't give a shell ( just a limited
    > CLI commands for configuring it . )My requirement is to write a telnet
    > server ( residing on the box) listening on some specific port where it
    > can listen to telnet requests from clients and provide them an
    > interactive command line session. I tried using the python's
    > async_chat module but it is very limited ..any wrappers around this
    > module so that it can be used more interactively ?? . Any pointers
    > would be highly appreciated . The current available CLI on this box
    > allows me to write python scripts remotely , ftp it and run them, so
    > executing them won't be problem.[/color]

    You should be able to use Twisted's telnet implementation for this. There's
    an implementation included where the command line session is a pseudo-python
    interactive interpreter, which is implemented in twisted/manhole/telnet.py,
    the Shell and ShellFactory classes.

    You easily can see this in action by running Twisted's mktap and twistd
    commands:

    mktap telnet --port 4040 --username foo --password bar
    twistd -nf telnet.tap

    You should be able to figure out how to implement your own telnet command
    interpreter in Twisted by reading that code -- if not, please ask for help
    on twisted-python@twistedm atrix.com

    -Andrew.


    Comment

    Working...