Telnet server implementation

K

kumar

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
 
A

Andrew Bennetts

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.

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 (e-mail address removed)

-Andrew.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top